6.1. Types and applications of session EJBs

There are two types of session EJB: stateful and stateless, distinguished by whether they can usefully store the state of an ongoing conversation with a client. Both can be thought of as models of services provided to clients. They implement the business [1] logic of the application. Both types are created and removed by clients, as required. They are not intended to be persistent, and the server does not have to take precautions to preserve their state in the event of a system crash (although it might).

[1] This is a generic term, used even if the EJB is not concerned with ‘business’ in the dictionary sense.

Get Applied Enterprise JavaBeans™ Technology 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.