Tag Archives: client site

Understand Distributed transaction & Two-Phase commit in Oracle

Understand Distributed transaction & Two-Phase Commit

A Distributed transaction involves one or more statements that update data on two or more separate nodes of a distributed database.
It is considered committed once all sites are prepared, and the transaction is confirmed at the commit point site.

Distributed Transaction terms:
Session Tree:
The database defines a session tree of all nodes participating in the distributed transaction.
Clients:
Client which refer information from another database node.
Database Server:
Database Server which host a database from which a client request data.
Local Coordinator:
A node that refer to another node for data to complete its transaction.
Global coordinator:
Node from which transaction is originating.
Commit Point:
System always choose one node to be commit point site.

Two-Phase Commit Mechanism

In Distributed Environment alerting data involves the multiple databases. In this committing or rolling is managed as a complete process means the entire transaction commits or the entire transaction rolls back. For maintain the integrity of data in a distributed transaction using the two-phase commit mechanism.

It includes phases:
Prepare Phase: global coordinator ask all Participating nodes other than commit site to promise for commit or rollback the transaction. if any node is cannot prepare then completed transaction is rollback.
Commit Phase: All nodes informed the coordinator at commit site that they are prepared and having all the needed resources for commit the transactions then coordinator ask commit site to commit. After commit all participating ask for commit the transaction.
Forget Phase: After got conformation from all nodes by the coordinator that they all are committed then commit site forget the transaction.

For more info: Understand In Doubt Transaction