An enterprise bean is a Java component that follows the EJB specification
from Sun Microsystems, Inc. Enterprise beans can be combined with other resources
to create distributed client/server applications.
There are two types of enterprise beans:
- Entity beans store permanent data. When you design an entity bean, you
must decide whether you want the enterprise bean to handle its data
synchronization, or whether you want the container to handle it.
- Bean-managed persistence (BMP) beans handle their own data
synchronization. BMP beans can require access to databases, XML files,
or other data stores.
- Container-managed persistence (CMP) beans allow the EJB
container to handle their data synchronization. CMP beans
require database access.
- Session beans do not require database access, though they can
obtain it indirectly (as needed) by accessing entity beans. Session beans
can also obtain direct access to databases (and other resources) through the use
of resource references.
Beans requiring data access use data sources, administrative
resources defining pools of database connections.
An EJB module is used to assemble one or more enterprise beans into a
single deployable unit.