3.3.7. Lifecycle callbacks
The lifecycle callbacks on a stateful session bean are more complicated than those of a
stateless session bean. The difference is for two reasons: stateful session beans are tied to
a particular client and stateful session beans can be passivated. Let's start by looking at the
Figure 3.9. The lifecycle of a stateful session bean. A stateful bean maintains the client state and cannot be pooled.
It may be passivated when the client isn't using it and must be activated when the client needs it again.
1 . The container always creates a new bean instance using the default constructor
whenever a new client session is started.
2 . After the constructor has completed, the container injects the resources such as JPA
contexts, data sources, and other beans.