1.3.1 Transaction Lifetime
At a general level, a transaction consists of a set of operations that an application or a set of applications treats as an atomic unit. These applications typically use one or more resource managers to modify and store the state that is affected by the transaction. The applications and resource managers make use of transaction managers to obtain a set of services. These roles are described further in section 1.3.3.
The transaction lifetime begins when an application determines that it needs a new transaction. The application assumes the role of root application and issues a Begin request to the root transaction manager. When a new transaction is created, either the root application or the root transaction manager assigns it an identifier that is unique in both time and space.
After the transaction is created, it enters the active phase. In the active phase, applications and resource managers perform all their intended actions inside the transaction.
Resource managers that perform work inside an atomic transaction contact their transaction manager to enlist on the transaction. By enlisting in a transaction, the resource manager is agreeing to participate in the Two-Phase Commit Protocol. For more information see [GRAY] section 10.4.
Applications and resource managers often share a transaction with a participant that is not located in the same operating system process or execution context. In this case, the application marshals the transaction to the other participant over an implementation-specific communication mechanism. If the receiving participant does not share a transaction manager with the sending participant, a transaction propagation handshake occurs to coordinate the transaction managers at both the sender and receiver of the transaction. After the transaction is successfully marshaled and (if needed) propagated, the receiving participant can perform operations on the transaction with its own transaction manager and also marshal the transaction to further participants.
As transaction enlistment and propagation occurs, the collection of resource managers and transaction managers relate to each other in a hierarchy known as a transaction tree.
The following figure depicts the transaction tree.

Figure 1: Transaction tree
Eventually, the root application that began the transaction determines that no more work is to be performed under the transaction. When that occurs, the application sends a Commit request to the root transaction manager to begin the process of completing the transaction.
When the root transaction manager receives the Commit request, it begins the process of determining the transaction outcome and communicating that outcome to all interested participants. That process begins with zero or more Phase Zero waves followed by Phase One and Phase Two of the Two-Phase Commit sequence.