Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5EAAD9C75 for ; Wed, 4 Apr 2012 13:54:25 +0000 (UTC) Received: (qmail 20301 invoked by uid 500); 4 Apr 2012 13:54:21 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 20240 invoked by uid 500); 4 Apr 2012 13:54:21 -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 20227 invoked by uid 99); 4 Apr 2012 13:54:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Apr 2012 13:54:21 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of barry.l.propes@citi.com designates 67.231.145.106 as permitted sender) Received: from [67.231.145.106] (HELO mx0a-00123c01.pphosted.com) (67.231.145.106) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Apr 2012 13:54:11 +0000 Received: from pps.filterd (m0030125 [127.0.0.1]) by mx0a-00123c02.pphosted.com (8.14.5/8.14.5) with SMTP id q34DrH7Q023602 for ; Wed, 4 Apr 2012 13:53:50 GMT Received: from mail.citigroup.com ([192.193.222.5]) by mx0a-00123c02.pphosted.com with ESMTP id 13n7yh6k32-1 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 04 Apr 2012 13:53:50 +0000 Received: from imbhub-ru02.nam.nsroot.net (namdlpdimpsw07.nam.nsroot.net [153.40.172.113]) by smtpinbound.citigroup.com (Switch-3.4.1/Switch-3.4.1) with ESMTP id q34DquxX002552 for ; Wed, 4 Apr 2012 13:53:17 GMT Received: from exnjiht04.nam.nsroot.net (EXNJIHT04.nam.nsroot.net [150.110.165.230]) by imbhub-ru02.nam.nsroot.net (Switch-3.4.1/Switch-3.4.1) with ESMTP id q34DmdD8021592 for ; Wed, 4 Apr 2012 13:53:46 GMT Received: from exlnjht01.lac.nsroot.net (150.110.183.28) by exnjiht04.nam.nsroot.net (150.110.165.230) with Microsoft SMTP Server (TLS) id 8.3.192.1; Wed, 4 Apr 2012 09:53:28 -0400 Received: from exgtht01.nam.nsroot.net (169.171.98.130) by exlnjht01.lac.nsroot.net (150.110.183.28) with Microsoft SMTP Server (TLS) id 8.3.192.1; Wed, 4 Apr 2012 09:53:28 -0400 Received: from exgtmb06.nam.nsroot.net ([169.171.98.118]) by exgtht01.nam.nsroot.net ([169.171.98.130]) with mapi; Wed, 4 Apr 2012 08:53:27 -0500 From: "Propes, Barry L " To: "'Tomcat Users List'" Date: Wed, 4 Apr 2012 08:53:26 -0500 Subject: RE: jdbc pool properties Thread-Topic: jdbc pool properties Thread-Index: Ac0SYQE2KboBKmAhRzWabvfCRTiqKAACK46Q Message-ID: <08382548D50D3049BD5599E1E3146B3416F43AC1A8@exgtmb06.nam.nsroot.net> References: <17972289.150.1333543571938.JavaMail.daniel@cleveland> In-Reply-To: <17972289.150.1333543571938.JavaMail.daniel@cleveland> 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-WiganSS: 01000000010018exlnjht01.lac.nsroot.net ID0044<08382548D50D3049BD5599E1E3146B3416F43AC1A8@exgtmb06.nam.nsroot.net> X-CFilter-Loop: Reflected X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.6.7498,1.0.260,0.0.0000 definitions=2012-04-04_05:2012-04-04,2012-04-04,1970-01-01 signatures=0 X-Virus-Checked: Checked by ClamAV on apache.org There are some databases that do go in and periodically kill off connection= s, aside from the Tomcat settings. In addition to testOnBorrow=3Dtrue, I also had two other attributes, but no= t sure if Tomcat 7.0 uses them or not, as I'm on 6.0.29. testOnBorrow=3D"true" timeBetweenEvictionRunsMillis=3D"-1" minEvictableIdleTimeMillis=3D"28800" -----Original Message----- From: Daniel Mikusa [mailto:dmikusa@vmware.com] Sent: Wednesday, April 04, 2012 7:46 AM To: Tomcat Users List Subject: Re: jdbc pool properties ----- Original Message ----- > My db connections seem to be lost after an extended period of > inactivity There could be a number of reasons that this occurs. Perhaps a network iss= ue is causing them to be disconnected or the database may be timing them ou= t. At any rate, it's not likely that the problem would be caused by the "r= emoveAbandoned" / "abandonedTimeout" settings, unless you application is no= t properly returning connections to the connection pool. https://tomcat.apache.org/tomcat-7.0-doc/jndi-datasource-examples-howto.h= tml#Preventing_database_connection_pool_leaks > (for a web application). And the only way to get the connections to > work again is to restart tomcat. > > My tomcat.jdbc.pool.Datasource settings have: > > > > > > > > You probably want to add testOnBorrow=3D"true" and "validationQuery=3DSELEC= T 1" (or some other valid query for your DB). See the following link for = an explanation of those properties. https://commons.apache.org/dbcp/configuration.html This will cause your connections to be validated prior to their use by your= application. Stale connections will be removed and replaced with new, wor= king connections. > > Is it the removedAbonded and abandonedTimeout? Does it mean "after 60 > seconds, remove the connection from the pool? No. See either of the links I've referenced above for an explanation of th= ese settings. > > I guess what I need is a minActive setting then? > There's no "minActive" setting. You have "minIdle", but I don't think that= would help here. Dan --------------------------------------------------------------------- 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