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 />

Transaction Manager for two-phase commit, you must set the “Allow unrecoverable<br />

completion” property to true in “Properties” for the Transaction Manager as<br />

displayed under the Partition in the BES Management Console. Alternatively, you<br />

can set system property EJBAllowUnrecoverableCompletion for the partition.<br />

The OTS engine exists in a separate address space. It provides a complete solution for<br />

distributed transactional CORBA applications. Implemented on top of the VisiBroker<br />

ORB, the OTS engine simplifies the complexity of distributed transactions by providing<br />

an essential set of services - including a transaction service, recovery and logging,<br />

integration with databases, and administration facilities - within one, integrated<br />

architecture.<br />

Distributed transactions and two-phase commit<br />

Note<br />

The <strong>Borland</strong> EJB Container supports distributed transactions. Distributed transactions<br />

are those transactions that cross systems, platforms, and Java Virtual Machines<br />

(JVMs).<br />

Transactions that manipulate data across multiple resources use a two-phase commit<br />

process. This process ensures that the transaction correctly updates all resources<br />

involved in the transaction. If it cannot update all resources, then it updates none of the<br />

resources.<br />

Although support is provided by BES for two-phase commit transactions, they are<br />

inherently expensive due to number of remote procedure calls (RPCs) and should be<br />

used only when needed. See “When to use two-phase commit transactions” on<br />

page 170.<br />

There are two steps to a two-phase commit. The first step is the preparation phase. In<br />

this phase the transaction service requests that each resource involved in the<br />

transaction readies its updates and signal to the transaction service whether it can<br />

commit the updates. The second step is the commit phase. The transaction service<br />

initiates the actual resource updates only when all resources have signaled that they<br />

can complete the update process. Should any resource signal they cannot perform<br />

updates, the transaction service instructs all other resources to rollback all updates<br />

involved in the transaction.<br />

The Transaction Manager and OTS engine support both heterogeneous distributed<br />

(two-phase commit) transactions and two-phase commit for homogeneous resources.<br />

By default, the Transaction Manager does not allow multiple resources to participate in<br />

a global transaction, but it can be configured to allow multiple resource participation<br />

through its support for unrecoverable transaction completion. This can be enabled on<br />

the Transaction Manager by setting either “Allow unrecoverable completion” option<br />

from the Management Console (right-click the Transaction Manager and select<br />

“Properties”), or the Partition system property EJBAllowUnrecoverableCompletion. When<br />

unrecoverable transaction completion is enabled, the container makes a one-phase<br />

commit call on each participating resource during the transaction commit process.<br />

Care must taken when enabling unrecoverable transaction completion; as the name<br />

suggests, no recovery is available when a failure occurs prior to transaction<br />

completion, which may lead to inconsistent states in participating resources.<br />

To support heterogeneous two-phase commit transactions, the OTS engine must<br />

integrate with XA support in the underlying resources. With availability of XA-enabled<br />

JDBC drivers from DBMS vendors and JMS support provided by message service<br />

providers, the EJB container and OTS engine allow multiple resources to participate in<br />

a single transaction.<br />

Two-phase commit for homogeneous databases requires some configuration of the<br />

DBMS <strong>server</strong>s. While the container controls the commit to the first database, the<br />

DBMS <strong>server</strong> controls the commits to the subsequent databases using the DBMS's<br />

built-in transaction coordinator. For more information, see your vendor's manual for the<br />

DBMS <strong>server</strong>.<br />

Chapter 19: Transaction management 169

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

Saved successfully!

Ooh no, something went wrong!