-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix an error which can occur if getAutoCommit is called on a closed connection #3135
Conversation
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.
Code review and test results:
Things to be aware of:
- Changes make sense
- Code is not hit in our code, only in external integrations
Things to worry about:
- Nothing
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.
Fix modifies JdbcConnection.rollback( ) logic to check if a connection is closed prior to checking for the autocommit state of the connection.
- This prevents errors due to calling getAutoCommit on a closed connection.
- Tomcat Connection Pool is an example of a JDBC connection type that disallows calling getAutoCommit on a closed connection.
APPROVED
Thanks for your PR submission! We just finished reviewing and merging it into the 4.17.0 release on October 10, 2022. When you get a chance, could you please Star the Liquibase project? The star button is in the upper right corner of the screen. |
Impact
Description
Some Connection implementations (e.g. Tomcat Connection Pool) don't allow calls to getAutoCommit after the connection is closed. This can cause errors if a JdbcConnection is closed more than once.