[jira] [Created] (DBCP-387) Have abandoned connection call cancel and rollback so it doesn't have to wait before closing

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (DBCP-387) Have abandoned connection call cancel and rollback so it doesn't have to wait before closing

ASF GitHub Bot (Jira)
Michael Kerr created DBCP-387:
---------------------------------

             Summary: Have abandoned connection call cancel and rollback so it doesn't have to wait before closing
                 Key: DBCP-387
                 URL: https://issues.apache.org/jira/browse/DBCP-387
             Project: Commons Dbcp
          Issue Type: Improvement
    Affects Versions: 1.4
         Environment: Linux, Java 1.6
            Reporter: Michael Kerr
            Priority: Minor


When using BasicDataSource and enabling Abandoned the destroyObject will be called when a connection has been out of the pool longer than a set period of time.
In testing I found that when a connection is reclaimed "destroyObject" is called.  This call uses close to free up the connection.  The problem is any activity on the connection will prevent the close from occuring.

A suggestion is to cancel active statements and then close them.  Then rollback the connection and close the connection.

PoolableConnectionFactory

    public void destroyObject(Object obj) throws Exception {
        if(obj instanceof PoolableConnection) {
            ((PoolableConnection)obj).reallyClose();
        }
    }


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira