Types of EJB

There are three basic bean types supported by the current EJB 2.0 specification:

  • Session beans are associated with a specific business action, particularly one requested during an interactive session. For example, the logic for totaling up an order might be encoded in a session bean. As their name implies, session beans are the primary application interface for synchronous, interactive sessions.

  • Entity beans are associated with an application object that requires persistent storage. For example, order and customer objects themselves could each be represented using entity beans. Session beans and message-driven beans typically interact with entity beans during execution when persistent data needs to be managed.

  • Message-driven beans ...

Get Building Scalable and High-Performance Java™ Web Applications Using J2EE™ 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.