Hi all.
We are having a big problem with Lazy associations.
To introduce the problem, let me explain some issues about an architecture.
We want to share only one session across the same Thread execution, using a Thread Local variable to mantain our session.
We have Controllers that call our DAO's to get persistent data.
Our controllers are EJB's, some of them using RequiresNew transaction type.
When a requiresNew method returns, JBoss automatically disconnect the session, closing the connection.
So, if try to access a lazy association in another moment, Hibernate tell us that the session is disconnected.
Anyone knows a solution for this kind of problem?
Can we reconnect the session if it has been disconnected?
Thank you all.
|