tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken Bowen <kbo...@als.com>
Subject Re: Connections timing out even with validation query??
Date Tue, 15 Jul 2008 16:34:02 GMT
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 <kbowen@als.com> 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:
>>
>> <Context path="" debug="5" reloadable="true" crossContext="true">
>> <Resource name="jdbc/sb_data" auth="Container"  
>> 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"/>
>
> <http://commons.apache.org/dbcp/configuration.html>
>
> 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


Mime
View raw message