Why Bean-Managed Transactions?

EJB with bean-managed transactions is the programmatic approach in which the EJB code invokes methods that mark the boundaries of the transaction. On Day 17, you learned about container-managed transactions. CMT is the declarative approach in transaction demarcation in which the container manages the transaction behind the scenes on behalf of the EJB, and according to the configuration of the EJB's deployment descriptor. You also learned that container-managed transaction is the approach that J2EE encourages you to use.

You might ask yourself why you should study bean-managed transactions. The answer is simple: Sometimes a container-managed transaction is not sufficient or adequate to perform certain transactional ...

Get Sams Teach Yourself EJB in 21 Days 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.