commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz (JIRA)" <>
Subject [jira] Commented: (DBCP-343) RemoveAbandoned setting closes the active connection.
Date Fri, 10 Sep 2010 10:20:32 GMT


Phil Steitz commented on DBCP-343:

Each time any of the createStatement(...), prepareStatement(...), or prepareCall(...) methods
are invoked, the last used property of the parent connection is updated by the DelegatingStatement
constructor.   Connections that execute queries that take longer than removeAbandonedTimeout
to run may get closed when pool maintenance runs.  If this is what you are seeing, you need
to either turn off abandoned connection cleanup (always better if you can just make sure that
your code actually closes all connections rather than relying on the pool to clean up after
you) or set the timeout longer than the time required to execute the longest-running query
that your application uses a pooled connection to execute. 

If the request here is to have DBCP periodically check the server-side active state of connections
in use by clients, I am inclined to close as WONTFIX.  If DBCP is not effectively updating
lastUsed after JDBC operations on checked out connections, then this is a DBCP bug.  In that
case, details on what operations were performed and ideally a test case would be greatly appreciated.

> RemoveAbandoned setting closes the active connection.
> -----------------------------------------------------
>                 Key: DBCP-343
>                 URL:
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.4
>         Environment: Linux 64 bit, Ubuntu 5.*
>            Reporter: Singaravelu Suburayan
>            Priority: Blocker
> The documentation says, RemoveAbandoned connection setting will remove only the connections
that are idle for the configured timeout. But I see it is closing the connections that are
> The logic in DBCP implementatoin shows that it calculate the idle time from the time
of the connection is created, irrespective of the connection is used. So it just close the
connection in removeAbandonedTimeout.
> In my code, I'm reusing the connection for more DB statements to do intensive db operations,
which hold the connection for more than 5 minutes . The connection will never be idle for
more than a few seconds.
> My setting of removeabandonedTimeout = 300 brutally closes the connection in 5 minutes,
without checking if the connection is in use or not.
> I assume it should involve the activity of the statement object also to do the idle time
> thanks,
> Sing

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message