In our codebase, some modules are running old version of hibernate 3.6.0. Other modules are running relatively newer version 4.1.7. Everything is working correctly. We have MySQL DB.
Now we started the effort to systematically migrate to latest version of hibernate.
First we decided to migrate the modules running on 3.6.0 to 4.1.7 so that all modules have the same hibernate version. When we do this, everything runs perfectly for like an hour. Then the performance of our website starts rapidly degrading, and finally we see that the hibernate queries just hang till they timeout. We see no exceptions (all code is in try/catch).
Question: What can be the reason for this timeout? Is it possible that the connection pool is getting full?
FYI - Some months ago we had seen similar symptom in another part of the code which was missing entityManager.close(). At that time the minute we added entityManager.close() the problem resolved. So we have scanned our entire code several times to make sure we close all entityManagers properly. Again, note that there is no problem if we switch back to 3.6.0. We tried upgrading to a 4.2.21 version of hibernate, which is newer than 4.1.7, in case that would help. But it has not helped.
Can you please advice what our next step should be to debug/resolve this issue?
The C3P0ConnectionProvider is located in the org.hibernate.c3p0.internal package. Remove the hibernate.connection.provider_class configuration because it’s not needed. Hibernate will know you are using c3p0.
There’s no URL, user, password settings so Hibernate will not know how to connect to the DB.