This figure shows the stateful session bean life cycle. There are four states: does not exist, method ready, method ready in transaction, and passive. To transition from the does not exist state to the method ready state, the following occurs: the newInstance method is invoked, dependency injection occurs (if any), and the session bean method annotated as PostConstruct or the ejbCreate method (if defined) is invoked. To transition from the method read state to the passive state, the container chooses the session bean as eligible for passivation and the following occurs: the session bean method annotated as PrePassivate or the ejbPassivate method (if defined) is invoked. To transition from the passive state back to the method ready state, the following occurs: the session bean method annotated as PostActivate or the ejbActivate method (if defined) is invoked. If the session bean remains in the passive state long enough to exceed the passivation timeout, the session bean moves to the does not exist state. To transition from the method ready state to the method ready in transaction state, the following occurs: a transaction is started and the session synchronization method afterBegin is invoked. To transition from the method ready in transaction state back to the method ready state, the following occurs for the success case: the transaction commits successfully, the session synchronization method beforeCompletion is invoked, the session synchronization method afterCompletion is invoked with an argument of true; the following occurs for the failure case: the transaction is rolled back and the session synchronization method afterCompletion is invoked with an argument of false.