Specifying a Stateful Session Bean

Specifying a stateful Session bean is similar to specifying a stateless Session bean. The remote interface defines access to the bean by remote clients, and every method of the remote interface must throw an RemoteException. The primary difference (from a specification viewpoint) is that there can be multiple create() methods in the home interface.

You will recall that a stateless Session bean allows only for a single create() method in the home interface, and this corresponds to the ejbCreate() method of the bean itself. For a stateful Session bean, the create() method can be overloaded, so that the stateful bean can be given some initial state. From the client's viewpoint, this is somewhat analogous to invoking ...

Get Sams Teach Yourself J2EE™ in 21 Days 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.