in the Improved Thread Local Pattern description
http://www.hibernate.org/207.html
it is said at the bottom:
Quote:
From the caller perspective he always gets an Ownership object and calls that closeSession with that identity as a parameter. For instance if the transaction flow is like Container1Servlet1----> Container1EJB1(M1-TXRequiresNew) ----> Container1EJB1(M2-TXRequired) , then both Container1EJB1(M1) and Container1EJB1(M2) will call the open session and close session at the beginning and end of the methods respectively. But the actual open will happen at the beginning of Container1EJB1(M1) (since there is no session associated at this time) and closes at the end of Container1EJB1(M1), (since M1 is the actual owner of the session)This ensures a single session per request.
So, what if M2 has the session still open (and needs it) when M1 closes it...
I am probably missing something...
Anyone showing me the path? Thanks!