Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 66729 invoked from network); 27 Apr 2003 23:08:53 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 27 Apr 2003 23:08:53 -0000 Received: (qmail 28715 invoked by uid 97); 27 Apr 2003 23:10:59 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@nagoya.betaversion.org Received: (qmail 28708 invoked from network); 27 Apr 2003 23:10:58 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 27 Apr 2003 23:10:58 -0000 Received: (qmail 66458 invoked by uid 500); 27 Apr 2003 23:08:51 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 66446 invoked from network); 27 Apr 2003 23:08:50 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 27 Apr 2003 23:08:50 -0000 Received: (qmail 28701 invoked by uid 50); 27 Apr 2003 23:10:56 -0000 Date: 27 Apr 2003 23:10:56 -0000 Message-ID: <20030427231056.28700.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: commons-dev@jakarta.apache.org Cc: Subject: DO NOT REPLY [Bug 19374] New: - Potential for DelegateStatement, DelegateResultSet to be left open X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19374 Potential for DelegateStatement, DelegateResultSet to be left open Summary: Potential for DelegateStatement, DelegateResultSet to be left open Product: Commons Version: unspecified Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: Other Component: Dbcp AssignedTo: commons-dev@jakarta.apache.org ReportedBy: jason@kumachan.net.nz There is a potential for DBCP to leave DelegateStatement and DelegateResultSet open when PoolableConnection is closed. PoolableConnection overrides DelegateConnection.close() method and returns the object to the pool. The pool will normally call PoolableConnectionFactory.passivate() which in turn calls DelegateConnection.passivate() that closes any open DelegateStatement and DelegateResultSet. When a pool is set up to testOnReturn and the validation fails, then passivate() is not called, only factory.destroyObject() is called. Also if a connection is returned with pool.invalidateObject() then factory.destroyObject() is only called. factory.destroyObject() just calls PoolableConnection.reallyClose() which closes the underlying connection and does not close any DelegateStatements and DelegateResultSets created. Obviously PoolableConnection.close() should override DelegateConnection.close() because the latter closes the underlying connection which we don't want to have happen. It is relying on the pool to call passivate() when the object is returned to the pool, so it doesn't need to call passivate() itself. Solutions? Perhaps PoolableConnectionFactory.destroyObject() should call DelegateConnection.passivate()? Perhaps PoolableConnection.close() should use the PoolableConnectionFactory.passivateObject() code, and PoolableConnectionFactory. be modified to do nothing? This would return a clean connection back to the pool. I thought GenericObjectPool might have been at fault but I think it seems reasonable for the pool to not passivate() and object and only call factory.destroyObject() and have it clean everything up. --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org