user manual
202 BES Developer’s Guide
Transaction manager services
The example archive used is complex.ear, in a BES Partition. It has three
beans:
■
OrderSesEJB: takes orders from customers, creates an order in the database,
and sends messages to the manufacturers for making parts.
■
UserSesEJB: creates new users in the company database. Only accesses a
single database, therefore only needs to access a 1PC engine (Transaction
Manager).
■
OrderCompletionMDB: receives a notification from the manufacturer about the
part delivery, and also updates the database using entity beans.
To configure this example deployment scenario:
1 Using the DDEditor, add the ejb.transactionManagerInstance property to the
beans OrderSesEJB and OrderCompletionMDB. Refer to the above XML extract
for this example.
2 Next, using the Management Console, start the OTS engine with factory
name set as "TwoPhaseEngine".
3 Keep the local Transaction Manager enabled.
The following diagrams show example interactions between the client, the
BES Partition, and how the BES Partition locates the right transaction service
based on the above configuration. All of the beans are assumed to have
container-managed transactions.
Example 1PC usage
1 (A) The client calls a method of UserSesEJB. This is an implementation of the
method that creates users in the database.
2 (B) Before the call is actually invoked, as shown below, the Partition uses
its in-process Transaction Manager to begin the transaction.
3 (C) The session bean does some database work.
4 (D) When the call is over, the Partition issues commit.
5 (E) The Transaction Manager calls commit_one_phase() on the database
resource.










