JCR-4521: Update commons-dbcp dependency to 2.14.0#320
Closed
oleosterhagen wants to merge 1 commit intoapache:trunkfrom
Closed
JCR-4521: Update commons-dbcp dependency to 2.14.0#320oleosterhagen wants to merge 1 commit intoapache:trunkfrom
oleosterhagen wants to merge 1 commit intoapache:trunkfrom
Conversation
The caching of the readOnly and autoCommit settings is deactivated in order to detect invalid connections from a shut-down Derby database. This corresponds to the behavior in Commons DBCP 1.x.
Contributor
|
Oops. Missed that one while working on this ourselves. Hold on. |
Contributor
|
This is superior to PR#326, because it actually addresses the root cause of the test failure. +1 for merging. |
mbaedke
approved these changes
Jan 26, 2026
reschke
added a commit
that referenced
this pull request
Jan 26, 2026
…terhagen Copied from #320 - thanks @oleosterhagen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a partial fix of JCR-4521. The request for more customization possibilities is not addressed here. Most of the changes are identical to the patch (JCR-4521.diff) from @reschke.
During the execution of the test suite the Derby database will be shut down several times. The associated database connections remain in the pool but are no longer valid and lead to test errors. I have discovered two options to fix the tests:
testOnBorrowand execute a validation query. With Commons DBCP 1.x this is not needed for the tests (see 2).cacheState. If the caching of thereadOnlyandautoCommitsettings is deactivated, these will be reset when returning a connection from the pool. During this operation the invalid connections will be discovered and thrown away. I have chosen this option in the implementation, because it corresponds to the behavior when using Commons DBCP 1.x. (The validation query in option 1 may have different runtime characteristics.)These options don't work:
ConnectionFactoryand may still be reused. Without reopening the pool this will not work.