9.4. Container-managed transaction demarcation

9.4.1. Fundamentals

With container-managed demarcation, the developer’s responsibilities are to

  • declare each method’s transaction attributes in the deployment descriptor, and

  • handle exceptions appropriately, calling EJBContext.setRollbackOnly() where necessary.

With container-managed demarcation, the container considers the transactional state at the beginning and end of every method call on an EJB. Based on the current transaction context, and the transaction attributes given in the deployment descriptor, the container can do one of four things before calling the method itself:

  • continue the current transaction;

  • suspend the current transaction and run the method without a transaction;

  • suspend the ...

Get Applied Enterprise JavaBeans™ Technology 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.