5.1. Introducing Stateful Session Beans

A stateful session bean keeps track of client-specific data over the course of a session. The client-related data is stored in instance variables of the stateful session bean. The lifetime of the bean corresponds to one client's session and its state reflects the work performed throughout the session. The session bean keeps track of the conversational state between the client and the bean. Throughout its lifetime, the EJB container assigns an instance of a stateful session bean to a single client. The state of any given instance is dependent on how the client creates the bean and the invocation of its business methods. When the session terminates, the bean's state is released and the bean's instance no ...

Get Enterprise JavaBeans™ Component Architecture: Designing and Coding Enterprise Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.