11.4. Stateful session beans

In this section we will illustrate the basics of stateful session beans. The stateful session bean life cycle is explained together with a sample application that shows that stateful session beans retain the state across the calls spanning multiple business methods.

Unlike stateless session beans, stateful session beans are not shared among multiple clients. Furthermore, stateful beans are not pooled. A stateful session bean is dedicated to one client for the life cycle of the bean instance. Once a stateful session bean is instantiated, it is dedicated to an EJBObject for its whole life cycle. This allowd us to retain state in instance variables of stateful session beans for the life of the instance.

11.4.1. The ...

Get WebSphere V3.5 Handbook 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.