EJB 3.0 Core Specification:A container may only passivate a stateful session bean instance when the instance is not in a transaction.
I was thinking how and when such a scenario come up. After thinking for a while the following struck me.
a) Client starts a transaction using UserTransaction JNDI lookup.
b) Client invokes business methods on the session bean via session beans business interface.
Client remains idle long enough so that container can decide to passivate the sesion bean instance servicing the client.But before transfering the converstaional state to secondary storage, container realizes that this instance is in the middle of a transaction and hence will not passivate the instance.
****************************************
---------------
Environment
---------------
EJB Version : 3.0
Application Server:
JBOSS 4.2.3.GA
J2SE: 1.5 or 5.0
OS: Windows XP
****************************************
a) Is my understanding correct? Are there any other scenarios ?
b) The container came to knew that the instance is middle of the transaction because the client requested the transaction from the transaction service provided by the container. Is this correct?
c) Why does not the container passivate the instance if its in the middle of a transaction. What is the problem?