How do I forcefully close a connection from a connection pool when it's taking too much time to close?
There are times closing connections takes a lot of time, like more than 10 minutes upto 1 hour, or worse, even for indefinite time, depending on how heavy or slow the query was. In a situation where the client cancels the query because it has been taking too much time, I would want to free up the underlying connection used as soon as possible. I tried cancelling the PreparedStatement, closing it, then closing the resultset, and then finally closing the connection. Cancelling took almost instantly. Closing the PreparedStatement and ResultSet took too much time that I had to wrap it in a