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 E129D9711 for ; Mon, 9 Jan 2012 15:22:35 +0000 (UTC) Received: (qmail 41175 invoked by uid 500); 9 Jan 2012 15:22:32 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 40772 invoked by uid 500); 9 Jan 2012 15:22:22 -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 40688 invoked by uid 99); 9 Jan 2012 15:22:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Jan 2012 15:22:16 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of anjibcs@hotmail.com designates 65.55.111.104 as permitted sender) Received: from [65.55.111.104] (HELO blu0-omc2-s29.blu0.hotmail.com) (65.55.111.104) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Jan 2012 15:22:06 +0000 Received: from BLU0-SMTP139 ([65.55.111.73]) by blu0-omc2-s29.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 9 Jan 2012 07:21:45 -0800 X-Originating-IP: [146.243.44.97] X-Originating-Email: [anjibcs@hotmail.com] Message-ID: Received: from [146.243.44.97] ([146.243.44.97]) by BLU0-SMTP139.phx.gbl over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Mon, 9 Jan 2012 07:21:44 -0800 Date: Mon, 9 Jan 2012 10:21:42 -0500 From: Anjib Mulepati User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Tomcat Users List Subject: Re: DB Connection error References: <1325617813.11518.3.camel@cleveland.mikusa.com> <08382548D50D3049BD5599E1E3146B34164DB2760E@exgtmb06.nam.nsroot.net> In-Reply-To: <08382548D50D3049BD5599E1E3146B34164DB2760E@exgtmb06.nam.nsroot.net> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 09 Jan 2012 15:21:44.0491 (UTC) FILETIME=[65551FB0:01CCCEE2] X-Virus-Checked: Checked by ClamAV on apache.org I did change my config.xml to And this morning when DB restart I had to restart the tomcat to get connection. What can be other solutions? On 1/3/2012 3:33 PM, Propes, Barry L wrote: > I also have the following attributes in mine, for what it's worth. > > maxIdle="30" > maxWait="10000" > maxActive="10" > testOnBorrow="true" > timeBetweenEvictionRunsMillis="-1" > minEvictableIdleTimeMillis="28800" > poolPreparedStatements="true" > removeAbandoned="true" > removeAbandonedTimeout="300" > logAbandoned="false" > > -----Original Message----- > From: Daniel Mikusa [mailto:dmikusa@vmware.com] > Sent: Tuesday, January 03, 2012 1:10 PM > To: Tomcat Users List > Subject: Re: DB Connection error > > On Tue, 2012-01-03 at 10:47 -0800, Chema wrote: >>> But in my application I have context.xml with following >>> >>> >>> >> driverClassName="oracle.jdbc.driver.OracleDriver" >>> maxActive="20" >>> maxIdle="10" >>> maxWait="-1" >>> name="jdbc/myName" >>> password="myPassword" >>> type="javax.sql.DataSource" >>> url="jdbc:oracle:thin:@//localhost:8080/MYDBS" >>> username="myUsername" >>> /> >>> >> Well, you can use validationQuery parameter with "SELECT 1 FROM >> DUAL;". > +1 > > Try adding validationQuery="SELECT 1 FROM DUAL" and testOnBorrow="true". > > When you restart the DB, it's going to disconnect all of the connections > in your pool. If you add a validation query and one of the "testOn*" > options (testOnBorrow is my personal favorite) then the pool will catch > the bad connections, remove them and assuming your DB is back online, > create new ones. > > Dan --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org