ch16 - Database System Concepts 5 th Ed. Silberschatz,...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Database System Concepts 5 th Ed. Silberschatz, Korth and Sudarshan, 2005 See www.db-book.com for conditions on re-use Chapter 16 : Concurrency Control Chapter 16 : Concurrency Control Version: Oct 5, 2006 Silberschatz, Korth and Sudarshan 16.<number> Database System Concepts - 5 th Edition Chapter 16: Concurrency Control Chapter 16: Concurrency Control Lock-Based Protocols Timestamp-Based Protocols Validation-Based Protocols Multiple Granularity Multiversion Schemes Insert and Delete Operations Concurrency in Index Structures Silberschatz, Korth and Sudarshan 16.<number> Database System Concepts - 5 th Edition Lock-Based Protocols Lock-Based Protocols 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 . Data item can be both read as well as written. X-lock is requested using lock-X instruction. 2 . shared (S) mode . Data item can only be read. S-lock is requested using lock-S instruction. Lock requests are made to concurrency-control manager. Transaction can proceed only after request is granted. Silberschatz, Korth and Sudarshan 16.<number> Database System Concepts - 5 th Edition Lock-Based Protocols (Cont.) Lock-Based Protocols (Cont.) Lock-compatibility matrix 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 Any number of transactions can hold shared locks on an item, but if any transaction holds an exclusive on the item no other transaction may hold any lock on the item. 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. Silberschatz, Korth and Sudarshan 16.<number> Database System Concepts - 5 th Edition Lock-Based Protocols (Cont.) Lock-Based Protocols (Cont.) Example of a transaction performing locking: T 2 : lock-S (A) ; read (A) ; unlock (A) ; lock-S (B) ; read (B) ; unlock (B) ; display (A+B) Locking as above is not sufficient to guarantee serializability if A and B get updated in-between the read of...
View Full Document

Page1 / 79

ch16 - Database System Concepts 5 th Ed. Silberschatz,...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online