[c3p0-users] unreturnedConnectionTimeout, closeConnection and stmt.cancel
Status: Beta
Brought to you by:
swaldman
From: JoeSmith <fi...@gm...> - 2007-06-21 00:58:55
|
I'm doing some testing with the "unreturnedConnectionTimeout" setting and have found that it works as hoped for when a Connection has been abandoned. However, we have some use-cases/requirements where a Connection is not returned to the Pool within the expected timeout period while it is still in use. What currently happens is the Connection is closed (the associated resources, Statements, ResultSets, etc.) are closed but the calling code is not made aware and then hangs (blocks without ever returning). I believe the fix would be to call stmt.cancel() in the NewPooledConnection class, just before calling stmt.close() in the cleanupUncachedStatements method. Is there any reason this would be unadvisable? Are there any circumstances where we would want to close a Statement, but not have it be cancelled? I realize it would be better to fix the calling code (or StoredProcedures, or query) so that they dont cause hangs. This is infrastructure code for a very large development effort and that is not always an immediate possibility. |