user manual

220 BES Developers Guide
MDBs and transactions
MDBs and transactions
See Chapter 23, Using JMS for information on using JMS within
transactions. This section deals exclusively with using MDBs in transactions.
The most common scenario of using MDBs in transactions is the desire to
have two-phase commit (2PC) completion of transactions started for the
onMessage() method. Such an MDB will have the REQUIRED transaction attribute.
However, if you have a Partition's 2PC transaction service running, then all
modules deployed to that Partition can discover it and attempt to use it. The
2PC engine will perform one-phase commit when only one resource is
registered, but it will suffer the RMI overhead of the 2PC engine when the
Partition's standard transaction manager would perform far better. To avoid
this possible waste of resources, you can add the following bean-level
property to the MDBs that require 2PC. Use the Console to navigate to the
module and Right-click it. Select DDEditor and select the required bean from
the Navigation Pane once the DDEditor appears. Click the Properties tab and
add this property. Define this property as a string:
ejb.transactionManagerInstanceName
For more information on 2PC and the transaction manager, go to Chapter 19,
Transaction management.
Note ejb.transactionManagerInstance is also supported for Entity and Session beans.