Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 10521 invoked from network); 1 Apr 2009 03:45:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Apr 2009 03:45:10 -0000 Received: (qmail 45306 invoked by uid 500); 1 Apr 2009 03:45:06 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 45228 invoked by uid 500); 1 Apr 2009 03:45:06 -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 45217 invoked by uid 99); 1 Apr 2009 03:45:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2009 03:45:06 +0000 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [192.61.61.103] (HELO usea-naimss1.unisys.com) (192.61.61.103) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2009 03:44:55 +0000 Received: from usea-nagw2.na.uis.unisys.com ([129.224.72.18]) by usea-naimss1 with InterScan Message Security Suite; Tue, 31 Mar 2009 22:44:34 -0500 Received: from usea-nagw2.na.uis.unisys.com ([129.224.72.53]) by usea-nagw2.na.uis.unisys.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 31 Mar 2009 22:44:34 -0500 Received: from usea-nahubcas1.na.uis.unisys.com ([129.224.76.114]) by usea-nagw2.na.uis.unisys.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 31 Mar 2009 22:44:33 -0500 Received: from USEA-EXCH7.na.uis.unisys.com ([129.224.76.38]) by usea-nahubcas1.na.uis.unisys.com ([129.224.76.114]) with mapi; Tue, 31 Mar 2009 22:44:30 -0500 From: "Caldarale, Charles R" To: Tomcat Users List Date: Tue, 31 Mar 2009 22:44:32 -0500 Subject: RE: Connection Pooling questions Thread-Topic: Connection Pooling questions Thread-Index: AcmyeKXHcy3xifKRTvGwQcV5fojZZgAAcCDQ Message-ID: <0AAE5AB84B013E45A7B61CB66943C17215E6D9B7C8@USEA-EXCH7.na.uis.unisys.com> References: <380-220094313156695@M2W035.mail2web.com> In-Reply-To: <380-220094313156695@M2W035.mail2web.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-OriginalArrivalTime: 01 Apr 2009 03:44:33.0945 (UTC) FILETIME=[2BED9890:01C9B27C] X-Virus-Checked: Checked by ClamAV on apache.org > From: allen.irwin@smartintegration.com.au > [mailto:allen.irwin@smartintegration.com.au] > Subject: RE: Connection Pooling questions >=20 > type=3D"javax.sql.DataSource" > driverClassName=3D"com.attunity.jdbc.NvDriver" > url=3D"jdbc:attconnect://10.20.5.107:7777/baynav;DefTdpName=3Dwebdemo" > maxActive=3D"50" maxIdle=3D"10"/> You said maxActive was 30, but it's 50 in your config. I've never used the= Attunity drivers, but the above looks ok as far as I can tell; perhaps som= eone else might see a problem. You might want to consider adding these: removeAbandoned=3D"true" removeAbandonedTimeout=3D"60" logAbandoned=3D"true" That will tell you if the pool thinks you're returning connections or not. = Change the timeout setting (in seconds) to whatever you think is appropria= te. > so you're saying that the pool will never close any of the connections > due to them not being used? Correct; that's normally left up to the database. > Here's the block I use: > finally > { > // cleanup > if (cs !=3D null) cs.close(); > if (conn !=3D null) conn.close(); > } > Where cs =3D the statement. If the cs.close() throws an exception, you won't close the connection. Do = you only ever have one statement per connection? And depending on the loca= tion of the finally block relative to the rest of the code, you might not e= ven go through there. > I don't close the result set as closing the > statement is supposed to do that. Regardless, it's good practice to clean up DB resources explicitly, prefera= bly as soon as you're done with them. > Maybe this timeout value is what I'm looking for? Depends on what you want; for a production environment, you never want the = connections to close. They're cheap to keep around but expensive to create= . - 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