Thursday, June 16, 2011

What is BMT?

BMT stands for Bean Managed Transaction. It is one of the way EJB prvides for the transaction management. Another one is CMT - Container Managed Transaction.
Unlike CMT, which let the application server handles the most of transaction management issues, BMT gives the developers more control over the transaction management. such as the transaction demarcation, start, commit or rollback the transaction.

The bean that can use BMT must be a session bean or MDB.

Although it is BMT, the container actually still does the most hard work of transaction management for the bean which manage the transaction itself. The container creates the physical transaction for the bean. This transaction is injected into the bean as one instance of javax.transaction.UserTransaction. The bean uses this instance of UserTransaction to start, commit or rollback the transaction.

No comments:

Post a Comment