Concurrency Control
Database System Concepts 3rd Edition 16.1 ©Silberschatz, Korth and Sudarshan
, Concurrency Control
Lock-Based Protocols
Timestamp-Based Protocols
Validation-Based Protocols (Optimistic Conc. Control)
Multiple Granularity
Multiversion Schemes
Deadlock Handling
Insert and Delete Operations
Database System Concepts 3rd Edition 16.2 ©Silberschatz, Korth and Sudarshan
, Lock-Based Protocols
One way to ensure isolation is to the data items be accessed in a
mutually exclusive mode.- While accessing the data items by a
transaction, no other transaction can modify that data item.
Lock is the common method- only the transaction allow to access
the data item if it is currently holding a lock on that item
A lock is a mechanism to control concurrent access to a data item
Data items can be locked in two modes
1. Exclusive (X) mode: read/write
2. Shared (S) mode: read
Lock requests are made to concurrency-control manager.
Transaction can proceed only after request is granted.
Database System Concepts 3rd Edition 16.3 ©Silberschatz, Korth and Sudarshan
, Lock-Based Protocols (Cont.)
Lock-compatibility matrix
Two lock modes allows multiple transactions to read a data item
but limits write access to just one transaction at a time.
At any time, Any number of transactions can hold shared locks
on an item
Database System Concepts 3rd Edition 16.4 ©Silberschatz, Korth and Sudarshan
Database System Concepts 3rd Edition 16.1 ©Silberschatz, Korth and Sudarshan
, Concurrency Control
Lock-Based Protocols
Timestamp-Based Protocols
Validation-Based Protocols (Optimistic Conc. Control)
Multiple Granularity
Multiversion Schemes
Deadlock Handling
Insert and Delete Operations
Database System Concepts 3rd Edition 16.2 ©Silberschatz, Korth and Sudarshan
, Lock-Based Protocols
One way to ensure isolation is to the data items be accessed in a
mutually exclusive mode.- While accessing the data items by a
transaction, no other transaction can modify that data item.
Lock is the common method- only the transaction allow to access
the data item if it is currently holding a lock on that item
A lock is a mechanism to control concurrent access to a data item
Data items can be locked in two modes
1. Exclusive (X) mode: read/write
2. Shared (S) mode: read
Lock requests are made to concurrency-control manager.
Transaction can proceed only after request is granted.
Database System Concepts 3rd Edition 16.3 ©Silberschatz, Korth and Sudarshan
, Lock-Based Protocols (Cont.)
Lock-compatibility matrix
Two lock modes allows multiple transactions to read a data item
but limits write access to just one transaction at a time.
At any time, Any number of transactions can hold shared locks
on an item
Database System Concepts 3rd Edition 16.4 ©Silberschatz, Korth and Sudarshan