Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 94573 invoked from network); 16 Jul 2008 12:28:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Jul 2008 12:28:37 -0000 Received: (qmail 74901 invoked by uid 500); 16 Jul 2008 12:28:24 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 74865 invoked by uid 500); 16 Jul 2008 12:28:24 -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 74854 invoked by uid 99); 16 Jul 2008 12:28:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Jul 2008 05:28:24 -0700 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 (athena.apache.org: domain of dns4@cornell.edu designates 128.253.83.142 as permitted sender) Received: from [128.253.83.142] (HELO authusersmtp.mail.cornell.edu) (128.253.83.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Jul 2008 12:27:29 +0000 Received: from [128.253.209.217] (dns4-endeavour.calsnet.cornell.edu [128.253.209.217]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.13.1/8.12.10) with ESMTP id m6GCKO6Z001988 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 16 Jul 2008 08:20:24 -0400 (EDT) Message-ID: <487DE78A.8070903@cornell.edu> Date: Wed, 16 Jul 2008 08:20:26 -0400 From: David Smith User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Tomcat Users List Subject: Re: [Same Behavior]Connections timing out even with validation query?? References: <4eedb92a0807150723k3d42bac7i5946fd51b7b75185@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org I don't think "1000*60" is a valid expression for timeBetweenEvictionRunsMillis -- at least I've never tried putting math expressions where an integer constant should be. It should be set to 60000. Also are you keeping your connections in code or closing them when finished? They should be closed as soon as reasonable so they can return to the connection pool. --David Ken Bowen wrote: > Unfortunately, overnight produced the same Exception, even with the > settings described. > Any other thoughts anyone? > > --Ken > > On Jul 15, 2008, at 12:34 PM, Ken Bowen wrote: > >> Definitely a plan. I put the following in my context.xml: >> >> validationQuery="select 1" >> testWhileIdle="true" >> timeBetweenEvictionRunsMillis="1000*60" >> removeAbandoned="true" >> >> I set connect_timeout=5 in /etc/my.cnf, and restarted both mysql and >> tomcat. >> After 30min, everything's fine, but that's not much of test. I'll >> see what it looks like tomorrow morning. >> >> Thanks, >> Ken >> >> >> On Jul 15, 2008, at 10:23 AM, Hassan Schroeder wrote: >> >>> On Tue, Jul 15, 2008 at 4:04 AM, Ken Bowen wrote: >>> >>>> The problem: With MySQL connect_timeout = 5, I'm getting timeout >>>> exceptions >>>> (below) even though I have a >>>> validation query set; Here's my app's META-INF/context-xml: >>>> >>>> >>>> >>> type="javax.sql.DataSource" >>>> maxActive="100" maxIdle="30" maxWait="10000" >>>> username="xxxxxx" password="xxxxxx" >>>> driverClassName="com.mysql.jdbc.Driver" >>>> url="jdbc:mysql://localhost:3306/sb_data" >>>> validationQuery="select 1"/> >>> >>> >>> >>> You might try setting testWhileIdle to true (with a reasonable value >>> for timeBetweenEvictionRunsMillis) and removeAbandoned to true. >>> >>> Just to see if that changes/eliminates the symptom... >>> >>> FWIW, >>> -- >>> Hassan Schroeder ------------------------ hassan.schroeder@gmail.com >>> >>> --------------------------------------------------------------------- >>> To start a new topic, e-mail: users@tomcat.apache.org >>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org >>> For additional commands, e-mail: users-help@tomcat.apache.org >>> >> >> >> --------------------------------------------------------------------- >> To start a new topic, e-mail: users@tomcat.apache.org >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org >> For additional commands, e-mail: users-help@tomcat.apache.org >> > > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > -- David Smith Programmer/Analyst College of Agriculture and Life Sciences Cornell University B32 Morrison Hall Ithaca, NY 14853 Phone: (607) 255-4521 --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org