tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Smith <>
Subject Re: tomcat can not connect to MySql
Date Sat, 22 Sep 2007 21:03:20 GMT
Can you provide some specifics of your environment?

Tomcat version
Mysql version (both driver and server)
Both tomcat and mysql on the same machine?
If not, any firewalls that might be timing out a connection?
How long does it run before it doesn't work?
Can you post the full stack trace of your exception including root cause?
In your design, are you holding on to connections or closing them as 
soon as you are done talking to the db?

Mysql server does timeout connections after 8 hours by default.  If you 
are using tomcat's database pooling, this can be fixed with the simple 
addition of a validation query in the config.  In any case, it's best 
practice for the code querying the db to close connections as soon as 
reasonably possible and not keep them open.


fdehghani wrote:
> I ues Appache tomcat as my App Server in my project
> but when running its service, after sometime when run my project,tomcat say
> that can not connect to database(SystemException)
> then i should restart its service to work correctly.
> i'm not sure thet its tomcat's problem or MySql
> please help me.

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message