ok, I am in a mood to rant about my travails in this matter, But I am choosing to cut the long story short.
It is very easy to setup a project that runs on Hibernate with the help of the multitude of beginner tutorials that come up on google search. And the settings and steps described there are good enough to carry you through your development schedule. But rememeber your hibernate settings are not production ready, i.e. not fit to be used on a machine that will stay turned on 24X7 and run your application in its Webserver container.
The problem you will face is this – You will deploy the application , and it will work smoothly. But shortly after a few hours, the DB will get disconnected with the following exception – detailed exception details here - http://pastebin.com/4KujAmgD
Hibernate Settings to be used to overcome the Communications Link Error are these
BUT, if you use these settings, and deploy your app, It will surely not work. Particularly if you use Hibernate 3. You have to do one more step -
Download the latest c3p0 tar.gz file from http://sourceforge.net/projects/c3p0/ Now put the c3p0-0.9.1.x.jar file into your Webcontents/WEB-INF folder.
Now when you deploy your application, it will work without failing. For explanations about what the above settings mean, refer to http://www.skill-guru.com/blog/2009/10/06/hibernate-tutorial-part-ii/
Hi vatsalad,
Thanks for these information.
I needed this rows in my hibernate.cfg.xml too
thread
org.hibernate.cache.NoCacheProvider
true
update
I think the only row I really need is the first one.
you have a error in these row:
com.mysql.jdbc.Driver
property not propert
I did not understand
Hi Karan, I am not sure what you did not understand. do let me know if you still need help. thanks
I have the same properties as yours. But I am still getting the error.
I am using OpenJPA for JPA in my application.
Hi Natraj, Just check the relevant configuration settings of all the items in your toolkit, i.e. your app, hibernate and that of your MySQL(i assume) installation. I am unable to give you a detailed answer as I am out of context with your app.