-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Connection created by SingleConnectionDataSource with suppressClose=true always returns isClosed=false even if the target connection is closed #24853
Comments
This is a bit of semantic issue since JDBC defines Are you using |
Actually it's some 3rd party code which does the following
If debug logging is enabled this code throws an I think that semantics should still be ok. I wouldn't change anything about the suppressClose logic - so ìsClosed |
Fair enough, let's adapt our semantics then, maybe even delegating |
thank you for the very prompt fix! |
If
SingleConnectionDataSource
is configured withsuppressClose=true
it will produce a Connection wrapped inCloseSuppressingInvocationHandler
.CloseSuppressingInvocationHandler
will always return false if theisClosed()
is being triggered on the wrapped connection. This is ok untilSingleConnectionDataSource#destroy()
is triggered which closed the connection on the wrapped Connection.I'd therefore suggest to change
to
Let me know if this change would be ok then I can create a pull request
The text was updated successfully, but these errors were encountered: