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
Add cancelQuery() from BaseConnection to PGConnection #1084
Comments
The sad thing with Java API does have "nuke the connection" option known as
I think we need to have some scoping, so For instance:
The interesting thing is Java 9 does have @davidtinker , any thoughts? |
Just in case: the alternative approach could be to make "socket processing" interruptible. For instance, |
I solved the "cancel whatever is randomly running" problem by ensuring that only the code that acquires and releases the connection does the cancelling. So once the connection has been released it won't get cancelled. |
fixed in #1157 |
I am using this method to get background threads running queries to stop e.g. when the result of the query is no longer needed. I know you can cancel at a statement level but that requires control over the code running the queries and introduces unnecessary coupling. Keeping track of the connection being used by the background operation is much simpler.
Original Stackoverflow POST
The text was updated successfully, but these errors were encountered: