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
- 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.
- 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.
- Write phase: After the validation phase passed successfully then the changes are made in the actual database.
Advantages of optimistic control protocol
- This protocol results in less interference during the execution of transactions.
- It will never let the transaction suffers from integrity loss.
- It ensures data consistency.