Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 50802 invoked from network); 1 Apr 2009 17:12:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Apr 2009 17:12:46 -0000 Received: (qmail 85776 invoked by uid 500); 1 Apr 2009 17:12:39 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 85733 invoked by uid 500); 1 Apr 2009 17:12:39 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 85691 invoked by uid 99); 1 Apr 2009 17:12:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2009 17:12:39 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [64.95.85.207] (HELO owa.fry.com) (64.95.85.207) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2009 17:12:32 +0000 Received: from aa-fry-ex07.fry.com ([64.95.85.207]) by aa-fry-ex07.fry.com ([64.95.85.207]) with mapi; Wed, 1 Apr 2009 13:12:09 -0400 From: Shaun Farrugia To: Tomcat Users List Date: Wed, 1 Apr 2009 13:12:08 -0400 Subject: RE: Connection Pooling questions Thread-Topic: Connection Pooling questions Thread-Index: AcmyfjtPVc1KfVWNRDaYKJ8MyjHHPwAVaHrQAACaKEAAAQQ5QAAEk6jg Message-ID: <35CEFEEA8B08EA428A8E1BC663353D735FE66F9E@aa-fry-ex07.fry.com> In-Reply-To: <35CEFEEA8B08EA428A8E1BC663353D735FE66EDF@aa-fry-ex07.fry.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org I ended up testing this based on the following Tomcat 5.5.27, JTDS 1.2, Abandoned Logging and Return set to 30 seconds and= true. Test A) Open connection, open Prepared Statement, Open Result set, Close Co= nnection Test B) Open Connection, open prepared Statement, open resultset. Didn't cl= ose anything. Test A Resulted in statements and result sets not affecting or throwing err= ors on the client side. Didn't check to see if cursors were open in the db Test B Resulted in Abandoned Pool thrown after waiting 30 seconds and execu= ting the test again. -----Original Message----- From: Shaun Farrugia [mailto:sfarrugia@fry.com]=20 Sent: Wednesday, April 01, 2009 11:00 AM To: Tomcat Users List Subject: RE: Connection Pooling questions Sweet, I set up a test.jsp page that will Connection.close() without rs.close() an= d ps.close(). Will let you know the results.. And I know you answered this before but I have to ask again. Tomcat is using it's own version of DBCP (based on properties files) Are t= here any changes to DBCP other than package moves? Can I utilize the DBCP = source package and expect that it's the same code tomcat is using? -----Original Message----- From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com]=20 Sent: Wednesday, April 01, 2009 10:47 AM To: Tomcat Users List Subject: RE: Connection Pooling questions > From: Shaun Farrugia [mailto:sfarrugia@fry.com] > Subject: RE: Connection Pooling questions >=20 > What happens when the statement isn't closed but the=20 > connection is returned to the pool? The connection object your code sees isn't the real connection; it's a wrap= per created by the pool to control access to the real thing. Likewise, the= ResultSet, Statement, PreparedStatement, etc., objects visible to the weba= pp are also wrappers around the real objects. Using these, the pool knows = if the real connection has been cleaned up properly; the pool won't reuse t= he connection until it is has returned to an idle state. > I have some code blocks that don't have a finally block=20 > to close the result set and prepared statement. If an=20 > exception happens the statement and the result set stay > open but the connection gets returned to the pool. A brief scan of the code in commons-dbcp indicates that when a Connection.c= lose() is done, an attempt is made to close the associated Statement and Re= sultSet objects. Some experimentation (which I don't have time for right n= ow) would make me more comfortable with that observation. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MA= TERIAL and is thus for use only by the intended recipient. If you received = this in error, please contact the sender and delete the e-mail and its atta= chments from all computers. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org