-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Tomcat/Hibernate
PostPosted: Thu Jun 09, 2005 4:17 pm 
Newbie

Joined: Thu Jun 09, 2005 4:13 pm
Posts: 7
I am not sure if this is a Tomcat issue or hibernate so I have posted this on both forums.

I deploy an application to Tomcat and it runs for about a day then when I come in the following day I can pull up my applications web pages but I can’t retrieve or add anything to the database. But, if I go and reload that app in Tomcat then everything works great for about a day then it doesn't work again and I go through the whole process all over. I really don’t have a clue on this. I am using Hibernate for my OR mapping and MySQL for the database.

Any help would be great!

Thanks

Hibernate version: 2.1.8


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 13, 2005 2:22 am 
Beginner
Beginner

Joined: Fri Feb 11, 2005 12:03 pm
Posts: 48
Location: Kiel, Germany
Sounds to me like a MySQL issue ;-)

You should check all your tomcat logs for an exception like
java.sql.SQLException: Communication link failure

In this case the MySQL server closed the connection on the server side invalidating your connection in your pool because the connection's idle time exceeded the wait_timeout of your MySQL server.

You can fix this by increasing the wait_timeout variable in your MySQL server or (better?) by using a connection pool which is able to validate and recreate connections before use (e.g. c3p0).


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 13, 2005 3:58 am 
Regular
Regular

Joined: Tue Nov 23, 2004 7:42 am
Posts: 82
Location: London, England
You should also add autoReconnect=true to your connection URL.


Top
 Profile  
 
 Post subject: It Works
PostPosted: Thu Jun 16, 2005 11:23 am 
Newbie

Joined: Thu Jun 09, 2005 4:13 pm
Posts: 7
Thanks for all the input. After using C3P0 I am not losing my connection anymore. :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.