JTA transactions and two-phase commit protocol
- Last Updated: February 11, 2026
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
Each transaction branch must be committed or rolled back by the local resource manager. The transaction manager controls the boundaries of the transaction and is responsible for the final decision as to whether or not the total transaction commits or is rolled back. This decision is made in a process commonly known as a two-phase commit protocol.
In the first phase, the transaction manager polls all of the resource managers involved in the distributed transaction to see if each one is ready to commit. If a resource manager cannot commit, it responds negatively and rolls back its particular part of the transaction so that data is not altered.
In the second phase, the transaction manager determines if any of the resource managers have responded negatively, and, if so, rolls back the whole transaction. If there are no negative responses, the transaction manager commits the whole transaction, and returns the results to the application.
The following example demonstrates the use of a two-phase commit protocol to commit one transaction branch:
|