Friday, December 01, 2006

Entity Bean and Transaction

Enterprise bean transactions can be bean managed or container managed, but entity beans can only use container-managed transactions.

In this case, the container manages the bean's transactions and is informed by the bean provider how the bean participates in a transaction. When a bean is transactional. it can be shared between multiple clients.

Session beans can be uniquely identified by an ID generated by the container. But such IDs are not enough for entity beans, since they are associated with data in a database.

Therefore, entity beans make use of the primary key class that uniquely identify the data in the database that the entity bean is associated with. So the primary key uniquely identifies both the entity bean and the underlying data in the database.

No comments: