Optimistic Concurrency Control Techniques, Phases, advantages

The optimistic control protocol is also called validation-based protocol which copies the transaction data locally and updates the local copy of data instead of actual data in the database.

It works in three phases

  1. Read phase: All transaction data are read and stored in a temporary variable which is also called the local variable of that transaction, after which a write operation is performed on the temporary variable.
  2. Validation phase: In this phase, a test is performed to determine if the changes of the local variable are also possible in the actual database. This phase ensures the violation-free change in the execution of a transaction.
  3. Write phase: After the validation phase passed successfully then the changes are made in the actual database.

Advantages of optimistic control protocol

  1. This protocol results in less interference during the execution of transactions.
  2. It will never let the transaction suffers from integrity loss.
  3. It ensures data consistency.