Sunday, June 1, 2014

EJB 3.1: Stateful Session Bean lifecycle



SFSB Lifecycle, from book "Oreilly Enterprise Javabean 3.1, 6th Edition"
Lifecycle events:
@PostConstruct
@PreDestroy
@PrePassivate
@PostActivate

With SessionSynchronization:
SFSB Lifecycle with SessionSynchronization, from book "Oreilly Enterprise Javabean 3.1, 6th Edition"
Programming Rules for Stateful Session Beans:

  • The Stateful Session Beans maintain conversational state, so the instance variables must be Java primitives or Serializable objects.
  • Since the SFSBs cannot be pooled like the SLSBs, there can be the risk of accumulating too many of them. So the client can explicitly request the removal of a bean by calling a method annotated with the @Remove annotation.

No comments:

Post a Comment