This chapter describes how to control concurrent execution in a database, in order to ensure the isolation properties of transactions. A variety of protocols are described for this purpose. This chapter presents the following content: Lockbased protocols, timestampbased protocols, validationbased protocols, multiple granularity,. | Chapter 16 : Concurrency Control Version: Oct 5, 2006 Database System Concepts 5th Ed. © Silberschatz, Korth and Sudarshan, 2005 See for conditions on reuse Chapter 16: Concurrency Control s LockBased Protocols s TimestampBased Protocols s ValidationBased Protocols s Multiple Granularity s Multiversion Schemes s Insert and Delete Operations s Concurrency in Index Structures Database System Concepts 5th Edition 16. ©Silberschatz, Korth and Sudarshan LockBased Protocols s A lock is a mechanism to control concurrent access to a data item s Data items can be locked in two modes : 1. exclusive (X) mode. Data item can be both read as well as written. Xlock is requested using lockX instruction. 2. shared (S) mode. Data item can only be read. Slock is requested using lockS instruction. s Lock requests are made to concurrencycontrol manager. Transaction can proceed only after request is granted. Database System Concepts 5th Edition 16. ©Silberschatz, Korth and Sudarshan LockBased Protocols (Cont.) s Lockcompatibility matrix s A transaction may be granted a lock on an item if the requested lock is compatible with locks already held on the item by other transactions s Any number of transactions can hold shared locks on an item, q but if any transaction holds an exclusive on the item no other transaction may hold any lock on the item. s If a lock cannot be granted, the requesting transaction is made to wait till all incompatible locks held by other transactions have been released. The lock is then granted. Database System Concepts 5th Edition 16. ©Silberschatz, Korth and Sudarshan LockBased Protocols (Cont.) s .