-
Notifications
You must be signed in to change notification settings - Fork 174
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
Exception thrown while establishing a new JDBC connection after Thread.stop #1461
Comments
@MohamedKamarudeen like I mentioned in your other issue, you don't want to call Thread.stop().
First off, did you avoid the problem that you originally reported in this issue by doing so? Do you have sample code of what it is exactly you're doing in the different threads involved and when you invoke the Thread.interrupt() method? |
@sfc-gh-wfateem - Please find the attached program below to test the interruption that was not honored.
|
@sfc-gh-wfateem any update? is it reproducible? |
Closing this because as I highlighted a while back, you shouldn't be calling Thread.stop(). |
Scenario:
Establish a new Snowflake JDBC connection
Execute any query by using the PreparedStatement
Do a Thread.stop() call to the query execution thread while query execution is in progress
After Thread.stop() has successfully completed, try establishing a new JDBC connection, below exception is thrown
Exception Message:
Message: Invalid state: Connection pool shut down. A potential cause is closing of a connection when a query is still running..
Exception Stack Trace:
Not able to establish a new connection once this exception has occurred.
Possible cause :
Internally a field isShutDown is maintained by net.snowflake.client.jdbc.internal.apache.http.impl.conn.PoolingHttpClientConnectionManager which might be set to true when Thread.stop() is called. On subsequent calls as this flag is set to true new connection seems to be rejected by the above exception, as net.snowflake.client.jdbc.internal.apache.http.impl.conn.PoolingHttpClientConnectionManager is maintained as SingletonObject (static).
Able to establish a new JDBC connection after this Java application is killed and restarted. Is there any other way to establish a new connection without kill and restart?
The text was updated successfully, but these errors were encountered: