Distributed Transactions

A distributed transaction is a transaction that updates data on two or more networked computer systems. Distributed transactions extend the benefits of transactions to applications that must update distributed data. Implementing robust distributed applications is difficult because these applications are subject to multiple failures, including failure of the client, the server, and the network connection between the client and server. In the absence of distributed transactions, the application program itself must detect and recover from these failures.

For distributed transactions, each computer has a local transaction manager. When a transaction does work at multiple computers, the transaction managers track incoming and outgoing transactions. Each transaction manager performs all the enlistment, prepare, commit, and abort calls for local resource managers (those that reside on that particular computer). When committing a transaction that is distributed among several computers, the transaction manager sends prepare, commit, and abort messages to all its outgoing transaction managers. When a transaction manager is in-doubt about a distributed transaction, the transaction manager queries the incoming transaction manager. The root transaction manager is never in-doubt. If an in-doubt transaction persists for too long, the system operator can force the transaction to commit or abort.

See How Distributed Transactions Work for more information.