~ Office Supplies ~~ Buy Posters ~~ A-Z Products ~~ Website Advertising


Non-strict two-phase locking - Wikipedia

<<Up     Contents

Non-strict two-phase locking

Redirected from Two phase locking

In computer science, non-strict two-phase locking, also 2PL, is a locking method used in database management systems.

The rules for 2PL are similar to those of Strict 2PL:

  1. If a transaction T wants to read/write an object, it must request a shared/exclusive lock on the object.
  2. A transaction cannot request additional locks on an object once it releases any lock, and it can release locks at any time (not only at commit time as in Strict 2PL).

So, every transaction has a growing phase (it acquires locks) and a shrinking phase (it releases locks). 2PL allows only conflict serializable schedules.

2PL in action:

<math>D = \begin{bmatrix}
T1 & T2 \\ X(A) & \\ R(A) & \\
  & X(A)  \\
 & R(A) \\
 & X(B)\\
 & R(B) \\
 & W(B)\\
X(B) & \\ R(B) & \\ W(B) & \\ Com. &\\

 & Com. \end{bmatrix}</math>

Notice that in this schedule, A and B can be accessed by both T1 and T2 even before commit time.

The deadlocked schedule in Strict 2PL:

<math>G = \begin{bmatrix}
T1 & T2\\ X(A) & \\
  & X(B) &  \\
X(B) & \\
 & X(A) \end{bmatrix}</math>

Text: T1: X(A) T2:X(B) T1:X(B) T2: X(A)

does not need to be deadlocked in 2PL, since T1 and T2 can release its locks on its objects before the other transaction requests locks on the objects.

wikipedia.org dumped 2003-03-17 with terodump




 
 
35 ct Very pink red gemmy RHODOCHROSITE Gorgeous gemstone freeform Single gem piece Very nice PRETTY
 35 ct Very pink red my RHODOCHROSITE Gorgeous freeform Single piece Very nice PRETTY 
 
17 grams light green new jade Serpentine gem stone Tumble polished cab cabbing rough 89 carat Nice
 17 grams light green new jade Serpentine Tumble polished cab cabbing 89 carat Nice 
 
78 carats CHRYSOBERYL gems stones Facet uncut raw rough gemstones crystals lot 4 to 5 ct 15 grams gr
 78 carats CHRYSOBERYL uncut raw crystals lot 4 to 5 ct 15 grams gr 
 
11 carats pink Rhodonite gem Polished rectangle blocks Cabbing cab cabochon rough gemstone freeforms
 11 carats pink Rhodonite Polished rectangle blocks Cabbing cab cabochon freeforms 
 
10 gram pink KUNZITE crystal specimen gem stone Cab cabbing cabochon rough uncut gemstone 51 carat 4
 10 gram pink KUNZITE crystal specimen Cab cabbing cabochon uncut 51 carat 4