|
From: Colin S. <col...@ex...> - 2004-03-25 15:58:53
|
I am tracking down a possible Hibernate resource management issue. In a running app, some time yesterday, some code, running in a wrapped transaction with Hibernate handling ORM, encountered an Oracle constraint violation and threw an exception. Fine... But when I log into the app myself now via the web ui and then it gets a service object to read some data, the service object is wrapped with a transaction interceptor, and also a hibernate interceptor. The Hibernate interceptor is already seeing a Hibernate Session existing on the current thread, so it is not creating a new one. Then at the end of the transaction, when the Hibernate session is attempted to be flushed, Hibernate tries to write out the old bad data from yesterday. What this essentially means is that when the error from yesterday happened, the session did not get released from the thread, and has been sticking around all this time. When I came via struts, I was given the same thread as yesterday by the appserver, and the old invalid session was still on it. The problem is not that it's reusing that session, but why it was ever left that the day before. Will try to duplicate this... |