-->
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.  [ 7 posts ] 
Author Message
 Post subject: net.sf.hibernate.JDBCException: Could not execute query
PostPosted: Thu Mar 10, 2005 2:17 pm 
Beginner
Beginner

Joined: Mon Feb 07, 2005 10:40 pm
Posts: 22
Hi I have a problem, after some time of inactivity like 1 hour I get the following error, if I restart the container everything works fine again, but after one hour the same again. I would appreciate it if somebody could help me. thanks. Raul.

Hibernate version:
2.1

Full stack trace of any exception that occurs:

java.lang.RuntimeException: net.sf.hibernate.JDBCException: Could not execute query
com.estudiowebs.BO.ProductBO.getProductList(ProductBO.java:295)
com.estudiowebs.Controller.ProductList.doGet(ProductList.java:63)
javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)


Name and version of the database you are using:

MySQL 4


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 10, 2005 2:19 pm 
Expert
Expert

Joined: Fri Nov 07, 2003 4:24 am
Posts: 315
Location: Cape Town, South Africa
I seem to recall some setting that you can specify to the driver (autoreconnect??) that prevents this sort of behaviour with MySQL- search the forums - it has come up before.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 10, 2005 2:21 pm 
Expert
Expert

Joined: Fri Nov 07, 2003 4:24 am
Posts: 315
Location: Cape Town, South Africa
http://dev.mysql.com/doc/connector/j/en ... #id2629885


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 10, 2005 2:23 pm 
Expert
Expert

Joined: Fri Nov 07, 2003 4:24 am
Posts: 315
Location: Cape Town, South Africa
and just in case you were wondering - you can specify it in the properties file using
Code:
<connection-property name="autoReconnect">true</connection-property>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 10, 2005 2:27 pm 
Beginner
Beginner

Joined: Mon Feb 07, 2005 10:40 pm
Posts: 22
thanks for your quick response :), does that mean that I have to try to reconnect to mysql manually or is there a way to tell hibernate to do it.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 10, 2005 2:28 pm 
Beginner
Beginner

Joined: Mon Feb 07, 2005 10:40 pm
Posts: 22
Thanks :) this is really helpfull. I'm gonna try it. Did you have the same type of problem?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 10, 2005 2:37 pm 
Expert
Expert

Joined: Fri Nov 07, 2003 4:24 am
Posts: 315
Location: Cape Town, South Africa
Yes. But it went away when I migrated to postgres ;-)

(BTW Postgres 8.0 comes as a windows installer)


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