Previous Topic: Two-Phase Commit ProcessingNext Topic: Terminology


Two-Phase Commit Overview

Two-phase commit is a protocol used to ensure that all changes made within the scope of a distributed unit of recovery are either applied (committed) or backed out. As the name implies, a two-phase commit process is divided into two phases. In the first phase, resource managers participating in the unit of recovery prepare their resources to be committed. If they cannot do so, they inform the request or of the failure. In the second phase, the resource managers either make their changes permanent or back them out based on the overall outcome of the transaction.

If a resource manager indicates that it has successfully prepared its resources to be committed, it guarantees that the resources can be committed even if some adverse condition, such as a system failure, occurs prior to completion of the commit process. It is this guarantee that ensures that all changes are either applied or backed out in their entirety.

The remainder of this section first introduces some terminology related to two-phase commit processing and then describes some of the key aspects of a two-phase commit operation.