12.11.2014 Views

web server - Borland Technical Publications

web server - Borland Technical Publications

web server - Borland Technical Publications

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Transaction manager services<br />

The following diagrams show example interactions between the client, the BES<br />

Partition, and how the BES Partition locates the right transaction service based on the<br />

above configuration. All of the beans are assumed to have container-managed<br />

transactions.<br />

Example 1PC usage<br />

1 The client calls a method of UserSesEJB. This is an implementation of the method that<br />

creates users in the database.<br />

2 Before the call is actually invoked, as shown below, the Partition uses its in-process<br />

Transaction Manager to begin the transaction.<br />

3 The session bean does some database work.<br />

4 When the call is over, the Partition issues commit.<br />

5 The Transaction Manager calls commit_one_phase() on the database resource.<br />

Figure 19.1<br />

Example of 1PC usage<br />

Example 2PC usage<br />

1 The client calls OrderSesEJB.create() method to create a new order.<br />

2 Since the bean is configured to use the OTS engine named TwoPhaseEngine, the<br />

container locates the right transaction service named TwoPhaseEngine, and uses it<br />

for beginning the transaction.<br />

3 The session bean does some database work, and sends a message to a JMS<br />

queue.<br />

4 When the call is over, the Partition issues commit.<br />

5 The OTS engine coordinates the transaction completion with the database and the<br />

JMS resources.<br />

Chapter 19: Transaction management 173

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!