tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Smith <d...@cornell.edu>
Subject Re: Mysql timouts...
Date Thu, 22 Feb 2007 14:38:41 GMT
I think I see what's happening here.  You've told the database pool to
continually test connections every hour.  The validation query itself
most likely acts as a keep alive on the connection so it never actually
hits the 8 hour default time out of mysql.  Open connections will most
likely never go stale or close until tomcat itself is shutdown or the
pool starts closing the extra idle connections. 

Don't know what to tell you on the logic for maxIdle.  It's not well
documented other than to say that idle connections above x are closed. 
And maxIdleTime is not present at all in the docs I've read so it may
not be an option.

--David

Jacob Rhoden wrote:

> Thanks for your reply, I have read through that document and the one
> on the mysql website, and discovered these other parameters, so I
> added this as well. It didnt make any difference. The mysqladmin
> program still reports the connections going untouched for hours.
>
>      validationQuery="select 1"  testWhileIdle="true"
>      timeBetweenEvictionRunsMillis="60000"
>      minEvictableIdleTimeMillis="60000"
>
> David Smith wrote:
>
>> As a side note, drop the autoReconnect=true from your database url.
>> It's not recommended and actually does not prevent SQLExceptions on
>> connections that go stale.  It just restores the connection for the next
>> request after the exception.  The MySQL website has further information
>> regarding what autoReconnect actually does.  One of these days, the
>> tomcat docs should be updated to remove that.
>>   
>
> I will have to read the documents to find out why having the
> connection automatically reconnected if there was a problem is bad
> thing, it is not clear from first reading.
>
> Best Regards,
> Jacob
>
>
> __________________________________________________________
> Jacob Rhoden - http://rhoden.id.au/
>
> ---------------------------------------------------------------------
> 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