Information icon IBM Information Server, Version 8.1
Feedback

Two-phase commit for federated transactions

A federated system can use two-phase commit for transactions that access one or more data sources. Two-phase commit can safeguard data integrity in a distributed environment.

Consider these differences between one-phase commit and two-phase commit:

One-phase commit
Multiple data sources are updated individually by using separate commit operations. Data can lose synchronization if some data sources are successfully updated and others are not.
Two-phase commit
Commit processing occurs in two phases: the prepare phase and the commit phase. During the prepare phase, a federated server polls all of the federated two-phase commit data sources that are involved in a transaction. This polling verifies whether each data source is ready to commit or roll back the data. During the commit phase, the federated server instructs each two-phase commit data source to either commit the data or to roll back the transaction.

For example, if a transaction withdraws funds from one account and deposits them in another account by using one-phase commit, the system might successfully commit the withdraw operation and unsuccessfully commit the deposit operation. The deposit operation can be rolled back, but the withdrawal operation cannot because it already successfully committed. The result is that the funds are virtually "lost."

In a two-phase commit environment, the withdrawal and deposit transactions are prepared together and either committed or rolled back together. The result is that the integrity of the fund amounts remains intact.

Related concepts
The federated server and database
Wrappers and other federated objects
Query optimization
Rational Data Architect

PDF This topic is also in the IBM Information Server Introduction.

Update icon Last updated: 2008-09-15