I'm using Struts 2.2.1.1 and Hibernate 3.6.2.Final. I'm also using C3P0 for my connection pool which is running on Tomcat 7.0.11.
I'm having issues where my Hibernate Sessions are not being closed and I'm quickly exceeding the maximum number of open connections as configured in the "hibernate.c3p0.max_size" property.
I think it is because my Hibernate Sessions are opened but never closed. I'm opening Sessions from a SessionFactory that is stored in the ServletContext. I tried closing the session in a finally{} block on my Action class but that throws org.hibernate.LazyInitializationException exceptions.
I did some research and I found the Full Hibernate Plugin approach and also the Open Session in View approach.
I'm assuming this is a common problem and I'd like to get a feel for the most commonly used solution.
Another thing I noticed is the Full Hibernate Plugin supports Struts 2.0.9+ to 2.1.6 but I'm using 2.2.1.1. Not sure if this would be a problem or if the website just hasn't been updated to list the newer version.
Any input is much appreciated.