Important
CICS does not support entity beans directly. That is, entity beans cannot
run in a CICS EJB server. However, a session bean or program running in a
CICS EJB server can be a client of an entity bean running in a non-CICS EJB
server.
An entity bean:
- Is typically an object representation of business data, such as a customer
order. Typically, the data:
- Are maintained in a permanent data store, such as a database.
- Need to persist beyond the life of a client instance. Therefore, an entity
bean is relatively long-lived, compared to a session bean.
- Object can be accessed by more than one client at
the same time. This is possible because each instance of an entity bean is
identified by a primary key, which can be used to find
it via the home interface.
- Can
manage its own persistence (bean-managed persistence),
or delegate the task to its container (container-managed
persistence).
If the bean manages its own persistence, the bean developer
must implement persistence operations—for example, JDBC or SQL calls—directly
in the bean.
If the entity bean delegates persistence to the container,
the latter manages the persistent state transparently; the bean developer
doesn't need to code any persistence operations within the bean.
- May or may not be transactional. If it's transactional, all transaction
functions are performed implicitly by the EJB container and server. There
are no transaction demarcation statements within the bean code. Unlike session
beans, an entity bean is not permitted to manage its own OTS transactions.
See Enterprise beans—managing transactions.
- Is recoverable—it survives a server crash.