Basics of EJBs

In EJB 2.0, there are four types of EJBs:

  • Stateless session beans provide a service without storing a conversation state between method calls.

  • Stateful session beans maintain state; each instance is associated with a particular client.

  • Entity beans represent an object view of persistent data, usually rows in a database. Entity beans have a primary key as a unique identifier. There are two operational styles for entity beans: container-managed persistence (CMP) and bean-managed persistence (BMP).

  • Message-driven beans were added in EJB 2.0. Message-driven EJBs, the integration between JMS (Java Message Service) and EJB, are used to perform asynchronous work within the server.

Session Beans

Session beans (both stateful and stateless) ...

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.