3.3. Types of EJB

Version 1.1 of the EJB Specification [EJB1.1 4.3] defined two types of EJB: the session EJB and the entity EJB. Version 2.0 introduces a third type, the message-driven EJB [EJB2.0 4.3]. It is possible to envisage EJB applications where the EJBs don’t fit neatly into any of these categories, but in practice one of these types can be adapted to suit most jobs. As there are separate chapters on each of these EJB types, the discussion here will be an outline only.

3.3.1. Session EJBs

A session EJB is a nonpersistent object: Its lifetime is the duration of a particular interaction between the client and the EJB. The client normally creates an EJB, calls methods on it, and then removes it. If the client fails to remove it, the EJB ...

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.