-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
HikariCP does not evict (and call connection close) on Query Timeout #1308
Comments
@jbialos This is a little curious to me. Can you post your configuration? By default, when you close the connection (presumably in a try-with-resources or finally block), any "in-flight" (uncommitted) transaction should be rolled back by HikariCP. I also recommend upgrading to the latest HikariCP version to see if the issue still occurs. |
I have confirmed that cda2605 fixes the original problem in our system. Thanks! |
Environment
More configuration:
I'm moving a legacy application over to hikaricp. When a query times out and the driver throws a java.sql.SQLTimeoutException, the legacy connection pool evicts and closes the underlying MS SQL Driver connection. Upon SQLTimeoutException, HikariCP just closes the statement and does not evict.
The HikariCP behavior leaves a bunch of sleeping spids on the DB with open transactions. This is unacceptable for my specific use-case and DB configuration.
I can hack it and just call HikariDataSource.evictConnection() from my application code when the driver throws a SQLException that I deem unrecoverable. This fixes my problem. Am I missing the proper way to do this through configuration?
The text was updated successfully, but these errors were encountered: