Entity Beans and Locking

Entity beans are transactional, shared resources, simultaneously used by many clients. Clearly, to ensure that clients view consistent data, the EJB container and the database must enforce concurrency control. Entity EJBs are not written as re-entrant or thread-safe components. Each entity bean instance never has more than one thread of control in its object. This simplistic concurrency control is handled by the EJB container and mandated by the EJB specification. For this reason, methods in the entity bean class are not synchronized.

Database Concurrency

The database also provides concurrency control. The entity bean interacts with the database through its data access code and transactions. Generally, the database knows ...

Get J2EE™ Applications and BEA™ WebLogic Server™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.