You are on page 1of 11

Fundamentals of Database Systems

Seventh Edition

Chapter 21
Concurrency Control
Techniques

Copyright © 2016, 2011, 2007 Pearson Education, Inc. All Rights Reserved
Figure 21.1 Lock and Unlock Operations
for Binary Locks

Copyright © 2016, 2011, 2007 Pearson Education, Inc. All Rights Reserved
Figure 21.2 Locking and Unlocking
Operations for Two-Mode (Read/Write, or
Shared/Exclusive) Locks

Copyright © 2016, 2011, 2007 Pearson Education, Inc. All Rights Reserved
Figure 21.3 Transactions That Do Not Obey
Two-Phase Locking
(a) Two transactions T1 and T2. (b) Results of possible serial schedules of T1
and T2. (c) A nonserializable schedule S that uses locks.

Copyright © 2016, 2011, 2007 Pearson Education, Inc. All Rights Reserved
Figure 21.4 Transactions T1  and T2 , Which
T prime sub 1 and T prime sub 2 comma

Are the Same as T1 and T2 in Figure 21.3 but


Follow the Two-Phase Locking Protocol

Note that they can produce a deadlock.

Copyright © 2016, 2011, 2007 Pearson Education, Inc. All Rights Reserved
Figure 21.5 Illustrating the Deadlock Problem.
(a) A Partial Schedule of T1  and T2  That Is in a
T prime sub 1 and T prime sub 2

State of Deadlock. (b) A Wait-For Graph for the


Partial Schedule in (a)

Copyright © 2016, 2011, 2007 Pearson Education, Inc. All Rights Reserved
Figure 21.6 Lock Compatibility Tables. (a) Lock
Compatibility Table for Read/Write Locking
Scheme. (b) Lock Compatibility Table for
Read/Write/Certify Locking Scheme

Copyright © 2016, 2011, 2007 Pearson Education, Inc. All Rights Reserved
Figure 21.7 A Granularity Hierarchy For
Illustrating Multiple Granularity Level
Locking

Copyright © 2016, 2011, 2007 Pearson Education, Inc. All Rights Reserved
Figure 21.8 Lock Compatibility Matrix for
Multiple Granularity Locking

Copyright © 2016, 2011, 2007 Pearson Education, Inc. All Rights Reserved
Figure 21.9 Lock Operations to Illustrate a
Serializable Schedule

Copyright © 2016, 2011, 2007 Pearson Education, Inc. All Rights Reserved
Copyright

Copyright © 2016, 2011, 2007 Pearson Education, Inc. All Rights Reserved

You might also like