An enterprise bean is a Java component that can be combined with other resources
to create distributed client/server applications.
There are two types of enterprise beans, entity beans and session beans:
- Entity beans store permanent data. Entity beans with container-managed
persistence (CMP) require database connections. Entity beans with bean-managed
persistence manage permanent data in whichever manner is defined in the bean
code. This can include writing to databases or XML files, for example.
- 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.
All beans reside in enterprise bean containers, which provide an interface
between the beans and the application server on which they reside.