JCR-4521: Update commons-dbcp dependency to 2.14.0 #320
+16
−14
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.