Home | Previous Page | Next Page   Distributed Data > Multiphase Commit Protocols > Heterogeneous Commit Protocol >

How Heterogeneous Commit Works

The heterogeneous commit protocol is a modified version of the standard two-phase commit protocol. The postdecision phase in the heterogeneous commit protocol is identical to the postdecision phases in the two-phase commit protocol. The precommit phase contains a minor modification, and a new phase, called the gateway commit phase, is added to the heterogeneous commit protocol.

The following sections explain the modification to the precommit phase and the gateway commit phase. For a detailed explanation of the postdecision phases, see Postdecision Phase.

Precommit Phase

The coordinator directs each update participant (except the gateway participant) to prepare to commit the transaction.

If the updates satisfy all deferred constraints, all participants (except the gateway participant) return messages to the coordinator indicating that they can commit their piece of work.

Gateway Commit Phase

If all participants successfully return a message indicating that they are prepared to commit, the coordinator sends a commit message to the gateway. The gateway in turn sends a response to the coordinator indicating whether the gateway committed its piece of the transaction. If the gateway commits the transaction, the coordinator decides to commit the entire transaction. Figure 89 illustrates this process.

Figure 89. Heterogeneous Commit Phase That Results in a Committed Transaction
begin figure description - This figure shows the start of a gateway commit phase. The coordinator sends a commit message to the gateway participant. The gateway participant commits the work and returns the message "committed." The coordinator receives the gateway committed message. - end figure description

If the gateway fails to commit the transaction, the coordinator rolls back the entire transaction, as Figure 89 illustrates.

Heterogeneous Commit Optimization

The database server optimizes the heterogeneous commit protocol when the only participant that receives an update is a non-Informix database. In this case, the coordinator sends a single commit message to all participants without invoking the heterogeneous commit protocol.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]