Consider the following actions taken by transaction T1 on database objects X and Y:
R(X), W(X), R(Y), W(Y)
Explain how the use of Strict 2PL would prevent interference between the two transactions.
Strict 2PL:-
Def:- The first phase of Strict-2PL is the same as the 2PL. After acquiring all the locks in the first phase, the transaction continues to execute normally. But in contrast to 2PL, Strict-2PL does not release a lock after using it. Strict-2PL holds all the locks until the commit point and releases all the locks at a time.
Ans:- Strict 2PL would require T2 to obtain an exclusive lock on Y before writing to it. This lock would have to be held until T2 committed or aborted; this would block T1 from reading Y until T2 was finished, but there would be no interference.
ex;
T1 T2
R(X) W(Y)
W(X)
R(Y)
W(Y)
Get Answers For Free
Most questions answered within 1 hours.