next up previous
Next: Incremental Sharing Up: No Title Previous: Locking

Two-Phase Locking

This approach, developed by Jim Gray, locks data and assumes that a transaction is divided into a growing phase, in which locks are only acquired, and a shrinking phase, in which locks are only released. The use of 2-phase locks is illustrated in Figure 4.

A transaction that tries to lock data that has been locked is forced to wait and may deadlock, as shown in Figure 5.



Prasun Dewan
Tue Mar 20 13:49:53 EST 2001