Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 5991 invoked from network); 1 Apr 2009 03:15:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Apr 2009 03:15:47 -0000 Received: (qmail 15077 invoked by uid 500); 1 Apr 2009 03:15:43 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 15004 invoked by uid 500); 1 Apr 2009 03:15:41 -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 14993 invoked by uid 99); 1 Apr 2009 03:15:38 -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:15:38 +0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [168.144.250.184] (HELO xsmtp16.mail2web.com) (168.144.250.184) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2009 03:15:28 +0000 Received: from [168.144.108.35] (helo=M2W035.mail2web.com) by xsmtp16.mail2web.com with smtp (Exim 4.63) (envelope-from ) id 1Loquw-0003fe-N0; Tue, 31 Mar 2009 23:15:08 -0400 Message-ID: <380-220094313156695@M2W035.mail2web.com> X-Priority: 3 Reply-To: allen.irwin@smartintegration.com.au X-Originating-IP: 203.171.5.4 X-URL: http://mail2web.com/ From: "allen.irwin@smartintegration.com.au" To: users@tomcat.apache.org, users@tomcat.apache.org Date: Tue, 31 Mar 2009 23:15:06 -0400 MIME-Version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Subject: RE: Connection Pooling questions X-Virus-Checked: Checked by ClamAV on apache.org Thank you very much for your reply=2E my response to your responses follo= w: > Post your entire context=2Exml so we can see the rest of the element=2E Your=20 > settings may conflict with what the database expects, resulting in orphaned connections=2E Here it is: >> Also, the default behavior seems to be that the connections=20 >> never close within the pool when they are not being used=2E > That is the whole point of having a pool=2E so you're saying that the pool will never close any of the connections due= to them not being used=3F > The evidence suggests otherwise=2E You also need to close result sets a= nd statements=20 > associated with the connection, and all of the close() calls should be i= n a finally=20 > block to insure they always get executed=2E Here's the block I use: =09=09finally =09=09{ =09=09=09// cleanup =09=09=09if (cs !=3D null) cs=2Eclose(); =09=09=09if (conn !=3D null) conn=2Eclose(); =09=09} Where cs =3D the statement=2E I don't close the result set as closing the= statement is supposed to do that=2E > That usually depends entirely on how your DB is configured; if it has a high timeout=20 > value (most do), the connections will persist for a long time=2E You ca= n configure a=20 > timeout value for the pool to evict idle connections, but that's disable= d by default=2E Maybe this timeout value is what I'm looking for=3F Original Message: ----------------- From: Caldarale, Charles R Chuck=2ECaldarale@unisys=2Ecom Date: Tue, 31 Mar 2009 21:57:01 -0500 To: users@tomcat=2Eapache=2Eorg Subject: RE: Connection Pooling questions > From: allen=2Eirwin@smartintegration=2Ecom=2Eau > [mailto:allen=2Eirwin@smartintegration=2Ecom=2Eau] > Subject: Connection Pooling questions >=20 > I configure it using the suggested /META-INF/context=2Exml with: > maxActive=3D"30" maxIdle=3D"10" Post your entire context=2Exml so we can see the rest of the element=2E Your settings may conflict with what the database expects, resulting in orphaned connections=2E > I assumed that maxActive would limit the total amount of DB > connections that could ever be open at one time (in this case 30)=2E That limits the number the pool is managing=2E If the pool considers some= of them to be abandoned or in error, the number the DB knows about may be higher=2E > Yet from what I see it seems like I am limited to maxActive + maxIdle > connections open (in this case 40)=2E Is that true=3F Don't think so=2E > Also, the default behavior seems to be that the connections=20 > never close within the pool when they are not being used=2E That is the whole point of having a pool=2E > I do close the connections within my program using conn=2Eclose(); The evidence suggests otherwise=2E You also need to close result sets and= statements associated with the connection, and all of the close() calls should be in a finally block to insure they always get executed=2E > I thought that when the connections were not used that they=20 > would over time be "really" closed and I would end up with=20 > the maxIdle value of 10 open connections within my Pool=2E That usually depends entirely on how your DB is configured; if it has a high timeout value (most do), the connections will persist for a long time= =2E You can configure a timeout value for the pool to evict idle connections, but that's disabled by default=2E - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient=2E If you received this in error, please contact the sender and delete the e-mail an= d its attachments from all computers=2E --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat=2Eapache=2Eorg For additional commands, e-mail: users-help@tomcat=2Eapache=2Eorg -------------------------------------------------------------------- mail2web=2Ecom =96 What can On Demand Business Solutions do for you=3F http://link=2Email2web=2Ecom/Business/SharePoint --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org