6.1. Introducing Entity Beans

Our example entity bean models the customer data for the Music Collection shopping application. We'll delay describing it until after we've characterized entity beans in general.

An entity bean is an in-memory representation of persistent data. The persistence mechanism is either coded by the bean developer (bean-managed persistence) or provided by the container (container-managed persistence). For both bean-managed and container-managed entity beans, the EJB container manages life cycles and keeps the beans synchronized with the underlying database. Because multiple clients may share an entity bean (and possibly alter its state), the container and the bean developer must make sure that any updates occur within an ...

Get Enterprise JavaBeans™ Component Architecture: Designing and Coding Enterprise Applications now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.