2. Understanding the Replicator : Replicator Components : How Replication of Data Occurs : How Two-Phase Commit Works
 
Share this page                  
How Two-Phase Commit Works
Ingres Replicator uses a two-phase commit protocol to ensure the integrity of the distributed, replicated data. The term two-phase commit refers to the two phases required to commit a distributed transaction where two databases are updated. Unlike Ingres Ingres Star, Ingres Replicator updates only two databases at a time.
Two-phase commit occurs during the last step in the diagram in (see page How Replication of Data Occurs.
Note:  The two-phase commit protocols are not used on the target connection; therefore, the transaction is not left in its installation log file.
Two-phase commit during replication involves the following steps:
1. The Replicator Server sends the replication to a target DBMS server.
2. The Replicator Server prepares to commit the transaction between the local and the target databases.
3. If Step 2 is successful, the Replicator Server completes committing the transaction at the target and local databases.
If an interruption occurs during the two-phase commit (for example, a machine or database shutdown), it is possible that a willing-to-commit transaction can be left on the Transaction Log File of the source database. To clear the willing-to-commit transaction, you can restart the Replicator Servers. If this fails to remove the willing-to-commit transaction from the Transaction Log File, you need to use the lartool utility. For more information, see the Command Reference Guide.
Note:  Two-phase commit is not available for installations running the Ingres Cluster Solution. For more information, see the appendix “Cluster Support.”