tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Wingfield <>
Subject Re: JDBC/MySQL user login goes stale
Date Tue, 29 Nov 2005 12:24:27 GMT
Also be aware that autoReconnect=true only works (according to the mysql 
docs) for Connections with autocommit set to true.

If you are using a connection pool make sure it checks the validity of 
Connections every so often. This is configurable for DBCP:

If you aren't using a pool then implement some sort of heart beat code 
as the previous poster suggested.



Lists wrote:
> This is an interesting problem.   But first try setting   
> autoReconnect=true in your connections string.
> If you continue to experience a timeout..  Check the logs, and see  what 
> specifically is happening.  You may be experiencing an  exhaustion of 
> connections not being released properly.
> If it is a true timeout and autoReconnect does not solve it... try  
> writing a  heart beat (1/hour) to test if this keeps it up and running.
> Be cognizant of connections NOT being returned back to the pool by a  
> proper close.  Which does not mean that you're not closing correctly  
> from your code, you maybe experiencing a close issue with JDBC.  So,  
> the version of JDBC is certainly another item to check. :-)
> Hope that helps!
> jes
> On Nov 29, 2005, at 2:21, David W. Brown wrote:
>> Hello TC dev and Gurus, I have a webapp comprised of several  Servlets 
>> and JSP pages. The webapp is functioning very well but  after a few 
>> hours of no connections or interaction the TC webapp  loses its 
>> connection with the MySQL DB. We are using the server.xml  defined 
>> JDBC/MySQL security model using the users and user_roles  tables DB 
>> structure. The logins work perfectly until a few hours of  (like 
>> overnight) in attendance. Even thought the TC Servlet server  is still 
>> up and running logins all fail. After restarting TC the  login 
>> mechanism works perfectly. Particulars follow. Please advise.
>> TC Servlet server 5.5.7
>> MySQL 4.1
>> OS Windows XP (whistler).
>> David Brown
>> IT/Systems
>> USM-I KBR-Central
>> APO AE 09316
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> For additional commands, e-mail:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message