Skip to content
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

Merged
merged 2 commits into from
Sep 19, 2022

Conversation

gpsfl
Copy link
Contributor

@gpsfl gpsfl commented Aug 1, 2022

Impact

  • Bug fix (non-breaking change which fixes expected existing functionality)

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.

@nvoxland nvoxland added the SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions label Aug 30, 2022
@github-actions
Copy link

github-actions bot commented Aug 30, 2022

Unit Test Results

  4 620 files  ±0    4 620 suites  ±0   31m 33s ⏱️ - 5m 54s
  4 617 tests ±0    4 398 ✔️ ±0     219 💤 ±0  0 ±0 
54 576 runs  ±0  49 552 ✔️ ±0  5 024 💤 ±0  0 ±0 

Results for commit 8f0bcef. ± Comparison against base commit e742a88.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@nvoxland nvoxland left a 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

Copy link
Contributor

@XDelphiGrl XDelphiGrl left a 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

@nvoxland nvoxland merged commit 98430d3 into liquibase:master Sep 19, 2022
@kataggart kataggart added this to the NEXT milestone Sep 20, 2022
@tabbyf00
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autocandidate complexityLocal criticalityBlocker IntegrationTomcat SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions Severity3 sprint2022-34 TypeBug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

6 participants