Oracle7 Server Distributed Systems Volume I: Distributed Data
Read-Only Distributed Transactions
There are three cases in which all or part of a distributed transaction is read-only:
- A distributed transaction can be partially read-only if:
- only queries are issued at one or more nodes
- updates do not modify any records
- updates rolled back due to violations of integrity constraints or triggers being fired
In each of these cases, the read-only nodes recognize this fact when they are asked to prepare. They respond to their respective local coordinators with a read-only message. By doing this, the commit phase completes faster because Oracle eliminates the read-only nodes from subsequent processing.
- The distributed transaction can be completely read-only (no data changed at any node) and the transaction is not started with the SET TRANSACTION READ ONLY statement.
In this case, all nodes recognize that they are read-only during the prepare phase, and no commit phase is required. However, the global coordinator, not knowing whether all nodes are read-only, must still perform the operations involved in the prepare phase.
- The distributed transaction can be completely read-only (all queries at all nodes) and the transaction is started with a
SET TRANSACTION READ ONLY statement. In this case, only queries are allowed in the transaction, and the global coordinator does not have to undertake a prepare/commit. Updates by other transactions do not degrade global transaction-level read consistency, because it is automatically guaranteed by coordination of SCNs at each node of the distributed system.