Entity Beans

Entity beans are Enterprise JavaBeans that represent data objects in your application and are typically stored in a database. A client can invoke methods on an entity bean just as it can on a session bean, although in some applications, the entity beans might only be accessed by session beans.

Unlike session beans, entity are always stateful, that's the whole idea behind an entity bean. Also unlike session beans, the same entity bean can be accessed by multiple clients at the same time. The EJB container takes care of any transaction conflicts that might arise from the entity beans being shared.

The EJB container decides when it should load and store entity beans. Depending on the persistence model the bean uses, the container might ...

Get Special Edition Using Java™ 2 Enterprise Edition 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.