nishida
nishida

Reputation: 23

example for rigorous two phase locking

The image below shows an example of an S2PL transaction, can anyone convert this example to R2PL?

enter image description here

Upvotes: 0

Views: 168

Answers (1)

johncitizen
johncitizen

Reputation: 117

The differences between S2PL and R2PL is really only during the second phase, i.e. when they release read locks.

For S2PL, a transaction must hold all its write locks till it commits or aborts, while R2PL releases all locks only after commit or abort.

So, to convert it to R2PL, you just have to move the unlock(A) to after the commit point, and before unlock(B).

Upvotes: 0

Related Questions