Database-Management-System

Question 47

Consider the following two transactions: T1 and T2.

T1: read(A);
               read(B);
               if A=0 then B ← B+1;
               write(B);
T2: read(B);
               read(A);
               if B≠0 then A ← A-1;
               write(A); 
 

Which of the following schemes, using shared and exclusive locks, satisfy the requirements for strict two phase locking for the above transactions?

A
B
C
D
Question 47 Explanation: 
For strict 2PL the requirements are,
i) Exclusive locks should be released after the commit.
ii) No locking can be done after the first unlock.
(A) Wrong because to write x you need Exclusive Lock.
(B) Wrong because violating the 1st requirement.
(C) Correct.
(D) Wrong because violating the 1st requirement.
Correct Answer: C
Question 47 Explanation: 
For strict 2PL the requirements are,
i) Exclusive locks should be released after the commit.
ii) No locking can be done after the first unlock.
(A) Wrong because to write x you need Exclusive Lock.
(B) Wrong because violating the 1st requirement.
(C) Correct.
(D) Wrong because violating the 1st requirement.
0 0 votes
Article Rating
Subscribe
Notify of


0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: <b>Alert: </b>Content selection is disabled!!
Transactions
November 9, 2023
NTA UGC NET JUNE-2023 Paper-2
November 9, 2023
Transactions
November 9, 2023
NTA UGC NET JUNE-2023 Paper-2
November 9, 2023