Stateless Session EJBs

In the previous sections, we developed, deployed, and used a very simple stateless session EJB. In the following sections, we cover session EJBs in-depth and explain how to take advantage of container services such as transactions and security.

Stateless session EJBs are generally considered the easiest to program. Their simplicity has a number of advantages for both the bean writer and the EJB server. As their name implies, stateless session beans follow a stateless programming model.

In a stateless programming model, the object cannot maintain any state on behalf of its caller.

For instance, imagine we are developing a bank account stateless EJB. We might develop a remote interface Account.java with these methods:

Get J2EE™ Applications and BEA™ WebLogic Server™ 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.