New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Commit after schema creation for GC tool #8290
Conversation
By default the connections from JDBC datasource do not have autocommit on, so when we create schema the results of that creation are then rolled back. This change is intentional about commiting the schema changes.
I dont know if this is desirable or by design? But to me it seems like if i want to create a schema explicitly in the command prompt it should be committed to the database. |
Hi @Highstead thanks for reporting this. What database are you using? I am a bit surprised because DDL statements are usually committed right away (regardless of JDBC's auto-commit flag), and cannot be rolled back. |
I'm running Google's cloudsql in postgresql 15. This functionality maybe specific to google's cloudsql postgres 15? My setup is I port-forwarded localhost:5432 to cloudsql proxy(cloud-sql-proxy:2.7.0) inside the nessie's namespace. Then its just a simple follow the tutorial and watch it not apply the transactions. Below is the logs:
So with this line of code, i see the tables committed afterwards. Without it i see nothing. So its not like i've put it into a different database/schema. If this breaks any other implementation i'm happy to just close. |
IIRC, PostreSQL, indeed, may put DDL in a normal Tx and not commit automatically. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL Postgres has transactional DDL :-)
The changes make totally sense, thanks for fixing this @Highstead!
Per #8282 the CLA has been signed. |
By default the connections from the JDBC datasource do not have autocommit on, so when we create schema the results of that creation are then rolled back. This change is intentional about committing the schema changes.