Unit4 Transaction Part 2
Unit4 Transaction Part 2
Tech
Course Name: Database Management System
Course Code:E2UC302B
Concurrency Control Protocols
Concurrency Control is the working concept that is required for
controlling and managing the concurrent execution of database operations
and thus avoiding the inconsistencies in the database.
Thus, for maintaining the concurrency of the database, we have the
concurrency control protocols.
• The concurrency control protocols ensure the atomicity, consistency,
isolation, durability and serializability of the concurrent execution of the
database transactions. Therefore, these protocols are categorized as:
• Lock Based Concurrency Control Protocol
• Time Stamp Concurrency Control Protocol
• Validation Based Concurrency Control Protocol
Lock-Based Protocol
In this type of protocol, any transaction cannot read or write data until it
acquires an appropriate lock on it. There are two types of lock:
1. Shared lock:
It is also known as a Read-only lock. In a shared lock, the data item can
only read by the transaction.
It can be shared between the transactions because when the transaction
holds a lock, then it can't update the data on the data item.
2. Exclusive lock:
In the exclusive lock, the data item can be both reads as well as written by
the transaction.
This lock is exclusive, and in this lock, multiple transactions do not
modify the same data simultaneously.
There are four types of lock protocols available: