Comparing Stateless and Stateful Session Beans

Stateless session beans do not maintain state associated with any client. Each stateless session bean can server multiple clients.

Stateful session beans maintain the state associated with a client. Each stateful session bean serves exactly one client.

Stateless session beans are intended to be simple and lightweight; that is, they are easy to develop with low runtime resource requirements on the server. If required, any state is maintained by the client, and thereby makes the server highly scalable. Because no state is maintained in this enterprise bean type, stateless session beans aren't tied to any specific client. Therefore, any available instance of a stateless session bean can be used to service ...

Get Sams Teach Yourself EJB 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.