permaculture playing cards*
The moose likes Object Relational Mapping and the fly likes Problem with database timeout using Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Problem with database timeout using Hibernate" Watch "Problem with database timeout using Hibernate" New topic
Author

Problem with database timeout using Hibernate

Goran Markovic
Ranch Hand

Joined: Sep 26, 2008
Posts: 399
Hi, I have a problem because my application is idle over the night. The users of it have only interests to use it over a day light.
So, when the time between two use (communication) with database is over a 8 hours, the exception is thrown, telling me that 'timeout' should be set longer ( I have not now exception trace, but I will in morning ).
However, I have 'googled', over the net and try many things to set up inside my web.xml *either for sesionFactory and for dataSource - I and using Spring's templates for Hibernate). I have also tried to setup a variable of mysql timeout to longer then 8 h, but it had no effect. Here is the my present database configuration of web.xml;



I would really appreciate if someone help, because I am getting to have some real problems (and 'itchy') because of this.
Thanks in advance!
Goran Markovic
Ranch Hand

Joined: Sep 26, 2008
Posts: 399
Hi. Does anyone have an idea, what should I do to increase amount of time for timeout property?
I have changed my configuration file to this :



and, even I set "timeout" property to 0, which should mean no timeout, after about eight hours, I got this exception :



I would appreciate any help! Thanks!
Goran Markovic
Ranch Hand

Joined: Sep 26, 2008
Posts: 399
Just to inform anybody, who could have a similar problems, or the once related to connection pooling and database communication with it, to refer to this article, which I found very helpful connection pooling configuration.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with database timeout using Hibernate