Most complex component type in the EJB model.
Represent business objects and an in-memory view of persistent data (data in a database).
Can be shared by multiple users simultaneously.
Inherently transactional and can survive server crashes.
Persistent and represent the data even as it changes over time - periodic synchronization.
Bean-Managed Persistence:
Entity beans are responsible for making all necessary calls to synchronize data.
Container will notify the bean when to synchronize - normally occurs when a new transaction is started and after the transaction commits. This is achieved by calls to ejbLoad and ejbStore.
Container-Managed Persistence:
Containers are responsible for making all necessary calls to synchronize data - provides tools for generating necessary code, scripts or SQL statements.
The Bean Developer specifies container-managed persistent fields and relationship fields in the deployment descriptor.
The tools that the container provides for deploying a bean are not defined by EJB specification - can be different for different vendors.
Synchronous Interaction Between Session and Entity Beans