Hi, I have this problem: Our application is running on a tomcat 5.5 and uses hibernate with a mysql 5 database. It works great during office hours, but when we arrive in the morning, the tomcat is still running, but the database connections had been closed by the database. Hibernate doesn't know about this and tries to use them. If we reload the page after the exception we get, it starts working, because it creates new connections. I've been reading about this (http://www.mchange.com/projects/c3p0/index.html#configuring_recovery) and tried to configure c3p0 to handle this, but I get te same error. Also I don't know how to test this properly, so far I've been killing the connection thread with the mysql administrator.
This is the hibernate.cfg.xml
This is my c3p0.properties, which is located in the src folder of the project (the root of all packages).. does it go there?
Is my configuration ok? How can I prevent this error from happening? If it does happen, how can I prevent the application from failing? Thanks a lot. Pablo.
2B || !2B
Joined: May 18, 2007
Im having the same problem, when i see the stack of tcp connections from tomcat to hibernate, all the connections are in "close wait" state. I cant figure the reason, i hope someone can help !
Joined: Dec 12, 2006
We modified the hibernate.cfg.xml to use a datasource, instead of passing the connection parameters there, and it seems to be working that way. Unfortunatelly this is only a workaround and we still need to fix it the other way because we can't add datasources to the production server without restarting it, so applications should be able to handle the connection pool properly on their own. Thanks again