-->
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.  [ 3 posts ] 
Author Message
 Post subject: mysql killing the connection after X seconds?
PostPosted: Wed Jun 02, 2004 6:34 pm 
Newbie

Joined: Tue May 04, 2004 6:31 pm
Posts: 11
I was testing my application and after a certain amount of time I get a JDBCException, Could not execute query.

Is this because mysql is closing the connection after a certian amount of time?

To fix the problem, I just restart Tomcat and it works, so I'm not sure how the connection is being terminated.


I'm running Tomcat 5.0.24
MySQL 4.0.18
Hibernate 2.1.4

Thanks!
--

Nathan


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 03, 2004 1:13 pm 
Newbie

Joined: Tue May 04, 2004 6:31 pm
Posts: 11
sorry about the last post, here is a better description...

I am building a web app that allows users to log in. I am using mysql 4.0.20a, Tomcat 5.0.24, Hibernate 2.1.4, and struts.

Everything works great until I leave my application running overnight. WHen I come back in the morning and try to log in I get a
"Could Not Execute Query: JDBCException"

If I re-deploy my web app, everything works fine.

In trying to troubleshoot this problem, I've found that my web app never closes its connection with the mysql database, it merely sleeps. (I used the mysql control center to find this out).

Is this supposed to happen? Does hibernate just "sleep" when it isn't running queries? Is there a way to tell mysql to not kill the connection after the connection has been sleeping for a long time?

Thanks!
--
Nathan


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 03, 2004 1:20 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
search the forum for the mysql JDBC driver autoReconnect option.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.