Repository navigation
Fix BZ 69236 - reset JDBC interceptors in declaration order - #1101
Merged
markt-asf merged 1 commit intoOct 23, 2026
Merged
Conversation
markt-asf
requested changes
Oct 23, 2026
| //reset the chain in the order the interceptors are declared, for new and cached handlers alike | ||
| JdbcInterceptor next = handler; | ||
| while (next!=null) { | ||
| next.reset(this, con); |
Contributor
There was a problem hiding this comment.
You need to catch exceptions that happen here and wrap them in an SQLException
When a pooled connection was created, the interceptor chain was built from the last interceptor to the first and each interceptor was reset as it was added, so reset() was called in reverse order. For a connection taken from the pool the chain was reset from the first interceptor to the last. Build the chain first and then reset it in declaration order in both cases.
arturobernalg
force-pushed
the
bz-69236-interceptor-reset-order
branch
from
October 23, 2026 17:14
a954b4c to
4025006
Compare
Member
Author
|
@markt-asf Done. Exceptions thrown by reset() are now wrapped in an SQLException, for new and for reused connections, and there is a test for it. Could you have another look? |
Contributor
|
This clearly should not have been merged as is. I'll rework it (the test at least). |
Contributor
|
I already have it locally. Just need to tidy up a few things and I'll push it. |
Contributor
|
Thanks ! I was surprised this went in just like that, I guess it's easier for immediate back porting. |
Contributor
|
I'm trying to keep on top of user provided PRs so contributors don't feel ignored. Give me two minutes and I'll have the checkstyle issues fixed too. |
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.
Fixes https://bz.apache.org/bugzilla/show_bug.cgi?id=69236
When a pooled connection was created, the interceptor chain was built from the last interceptor to the first and each interceptor was reset as it was added, so
reset()was called in reverse order. For a connection taken from the pool the chain was reset from the first interceptor to the last.This change builds the chain first and then resets it in declaration order in both cases.
InterceptorResetOrderTestrecords thereset()calls of two interceptors for a new and for a reused connection. Without the change the new connection fails withexpected:<[first, second]> but was:<[second, first]>. With the change both pass. The other jdbc-pool test classes give the same results with and without the change.