You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Mark Thomas (JIRA)" <ji...@apache.org> on 2014/02/13 12:32:19 UTC
[jira] [Resolved] (DBCP-387) Have abandoned connection call cancel
and rollback so it doesn't have to wait before closing
[ https://issues.apache.org/jira/browse/DBCP-387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Thomas resolved DBCP-387.
------------------------------
Resolution: Won't Fix
If there is activity on the connection then the connection hasn't been abandoned. It would be better to address why a connection that is still in use has been marked as abandoned. Possible causes include:
- abandoned timeout is too low
- sql statement taking too long to execute (could indicate a performance issue)
- application not returning connections to the pool between uses
> 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
> Labels: features
>
> 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 was sent by Atlassian JIRA
(v6.1.5#6160)