RelationalDBDesign 





Network Topology   «Prev 

Distributed Transaction Management and Update Processing

Distributed transaction management refers to an Oracle database that can manage an update, insert, or delete to multiple databases from a single query. Most database vendors use the two-phase commit to implement this process. The two-phase commit insures that all the remote databases have successfully completed their sub-updates before the entire transaction is committed to the database.
Oracle implements this feature with the Recoverer process (RECO). RECO manages two-phase commits and allows Oracle to perform truly distributed transactions.


Introduction to Transactions

A transaction is a logical unit of work that contains one or more SQL statements. A transaction is an atomic unit.
The effects of all the SQL statements in a transaction can be either all committed (applied to the database) or all rolled back (undone from the database). A transaction begins with the first executable SQL statement.
A transaction ends when it is committed or rolled back, either explicitly with a COMMIT or ROLLBACK statement or implicitly when a DDL statement is issued. To illustrate the concept of a transaction, consider a banking database. When a bank customer transfers money from a savings account to a checking account, the transaction can consist of three separate operations:
  1. Decrement the savings account
  2. Increment the checking account
  3. Record the transaction in the transaction journal
Oracle must allow for two situations.
  1. If all three SQL statements can be performed to maintain the accounts in proper balance, the effects of the transaction can be applied to the database.
  2. However, if a problem such as insufficient funds, invalid account number, or a hardware failure prevents one or two of the statements in the transaction from completing, the entire transaction must be rolled back so that the balance of all accounts is correct.