Concurrency Control techniques in DBMS
Multiple transactions executing at the
same time on the same data may affect the result of the transaction.
In order to maintain concurrent
access to transactions, different protocols are introduced.
- Lock Based
Protocol
- Time-Stamp
Based Protocol
- Validation
Based Protocol
Validation Based Protocol (optimistic
concurrency control technique)
The validation phase is also known as the optimistic concurrency control technique.
In this
protocol, the transaction is executed in the following three phases:
- Read phase: In this phase, the transaction T is read
and executed. It is used to read the value of various data items and
store them in temporary local variables. It can perform all the write
operations on temporary variables without an update to the actual
database.
- Validation phase: In this phase, the temporary variable the value will be validated against the actual data to see if it violates the
serializability.
- Write phase: If the validation of the transaction is
validated, then the temporary results are written to the database or the system otherwise the transaction is rolled back.
Start(Ti): It
contains the time when Ti started its execution.
Validation
(Ti): It contains the time when Ti finishes its read phase and starts its
validation phase.
Finish(Ti): It
contains the time when Ti finishes its write phase.
- This protocol is used to determine the time
stamp for the transaction for serialization using the time stamp of the
validation phase, as it is the actual phase that determines if the
transaction will commit or rollback.
- Hence TS(T) = validation(T).
- The serializability is determined during the validation process. It can't be decided in advance.
- While executing the transaction, it ensures a
greater degree of concurrency and also less number of conflicts.
- Thus it contains transactions that have less number of rollbacks.
============================================
0 Comments