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
com.zaxxer.hikari.pool.ProxyConnection$ClosedConnection should return false for isClosed() instead of throwing an exception #1141
Comments
@tomdcc Is that true? The implementation of Are you possibly calling |
Sorry for the delay in replying, I haven't had time to try to recreate it, and the code that was triggering this has changed somewhat so it's not straight forward. I could have sworn that the reported stack trace showed the exception being thrown by Hmm. It does look like this sequence might do it, though I haven't verified it: Connection con = proxyConnection.unwrap(Connection.class);
// ...
con.isClosed(); This is simplified, the code as it stands doesn't make much sense. The unwrapping was happening away from the Caller expects to get an unwrapped connection for some reason, but gets the |
We can certainly add isClosed() to the interceptor. While an unusual pattern, it still should not throw an exception. |
…losed() or close() on a already closed Connection, as per JDBC specification.
…losed() or close() on a already closed Connection, as per JDBC specification.
Environment
See https://github.com/brettwooldridge/HikariCP/blob/HikariCP-3.1.0/src/main/java/com/zaxxer/hikari/pool/ProxyConnection.java#L478
It's not possible to check if a connection is closed by calling
isClosed()
without special exception handling as Hikari throws an exception. There should be a check for theisClosed
method in the handler that should just return false.The text was updated successfully, but these errors were encountered: