I’ve got a Java Application using Hibernate with the following details:
Java Web Application using Apache Tobago JSF Facelets
WebSphere Application Server v184.108.40.206
Informix Dynamic Server v12.1 Database using JDBC Driver v4.10.JC13
WebSphere JDBC Connection Pool
Operating System AIX v7.2
For the most part all is working well, but there is an intermittent problem where connections are not getting released back to the connection pool and therefore WebSphere is not able to reuse or close them, resulting in new connections having to be allocated. This also results in a memory leak on the JVM and over time it eventually runs out of resource and must be restarted.
The hibernate config file settings are as follows:
I appreciate that the problem is more than likely a coding error and when a certain exception is hit it is not handling it correctly and closing off the hibernate session correctly, but I was wondering if there is a way to setup a Max Age on the Hibernate Connections so that if they get stuck like this they will eventually time out and die.
There is a Maximum Age setting in WebSphere for the Connection Pool, but as it thinks that these connections are still doing something it won’t kills them off.
Is there a way to periodically loop through the active Hibernate Sessions and ask it to close them?
If further information is required in order to understand my requirements please let me know.
Any assistance would be appreciated