uCosminexus Application Server, EJB Container Functionality Guide

[Contents][Glossary][Index][Back][Next]

2.7.2 BMT

BMT is a model that performs transaction management in an Enterprise Bean. The BMT target is the Session Beans and the Message-driven Beans (BMT does not target the Entity Beans, the CMT target is always Entity Beans).

During BMT, use javax.transaction.UserTransaction in the business methods of the Enterprise Bean and perform the following operations:

  1. Start the transaction
  2. Update the resource manager
  3. Commit or roll back the transaction

In a Stateless Session Bean, one transaction needs to be concluded (committed or rolled back) in one business method. In a Message-driven Bean, a transaction needs to be concluded (committed or rolled back) in one of the following methods: The methods differ depending on the versions of EJB.

On the other hand, in a Stateful Session Bean, many business methods can be included in a single transaction scope. At this point, the EJB container maintains the relationship between the Bean instance and the transaction. The following figure shows the Stateful Session Bean in BMT:

Figure 2-6 Stateful Session Bean in BMT

[Figure]

Table 2-17 Transaction control in BMT

Client-side transactions Transactions of Bean instance Transactions connected to the methods
-- -- --
T1 -- --
-- T2 T2
T1 T2 T2

Legend:
--: Either a transaction is not started or is not mapped
T1: Transaction started in the client
T2: Transaction started in the Bean

Note
If a transaction is not concluded and a new transaction is started by using the UserTransaction.begin method, the EJB container throws javax.transaction.NotSupportedException.