I am using Hibernate 3.3.1GA.
I'm using the OpenSessionInViewFilter, and I'm running in to problems specifically when multiple requests are executed in quick succession. What happens is calls to SessionFactory.getCurrentSession() will return a closed session. Why does this happen?? Why would get current session ever return a closed session. Shouldn't it open a new session when the current session is closed?
To fix this, I added code to my HibernateUtil that would check to see if the session is closed, if so open a new one. The problem is still with quick requests, a few of them will get the "Session is closed!" exception. I'm absolutely baffled. I'm using tomcat, not using JNDI. Is tomcat letting threads get crossed somehow???
|