1 votes 1 votes Given Problem : S1 can be shown allowed under 2PL. However, the solution that they have provided for S2 : Seems wrong, as So, is S2 allowed under 2PL, or the answer given is incorrect? Databases databases transaction-and-concurrency 2phaselocking serializability + – palashbehra5 asked Jan 17, 2022 palashbehra5 968 views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply palashbehra5 commented Jan 17, 2022 reply Follow Share I went through the links sir, the questions are different, however, I observed https://gateoverflow.in/243003/Made-easy-test-series for this question, S2 has an acyclic precedence graph as well, but it is not allowed by 2PL protocol. https://faculty.cc.gatech.edu/~jarulraj/courses/8803-s21/slides/13-two-phase-locking.pdf “ There are potential schedules that are serializable but would not be allowed by 2PL. “, Slide No 23. https://gateoverflow.in/42378/Conflict-serializable-and-2pl-schedule is an another good example of this. 2 votes 2 votes Isha_99 commented Jan 17, 2022 reply Follow Share You are right @palashbehra5 there are even some conflict serializable schedules that are not allowed under 2PL. 3 votes 3 votes Please log in or register to add a comment.
Best answer 5 votes 5 votes This is how I solved and get S2 allowed under 2PL Isha_99 answered Jan 17, 2022 selected Jan 17, 2022 by palashbehra5 Isha_99 comment Share Follow See all 3 Comments See all 3 3 Comments reply palashbehra5 commented Jan 17, 2022 reply Follow Share I see, I was under the impression that before every read and writes, a lock is supposed to be acquired. 1 votes 1 votes Isha_99 commented Jan 17, 2022 reply Follow Share No , that is not the case . This defination of 2pl locking from Korth – 15.1.3 The Two-Phase Locking Protocol One protocol that ensures serializability is the two-phase locking protocol. This protocol requires that each transaction issue lock and unlock requests in two phases : 1. Growing phase. A transaction may obtain locks, but may not release any lock. 2. Shrinking phase. A transaction may release locks, but may not obtain any new locks. Initially, a transaction is in the growing phase. The transaction acquires locks as needed. Once the transaction releases a lock, it enters the shrinking phase, and it can issue no more lock requests 2 votes 2 votes ankit3009 commented Jan 17, 2022 reply Follow Share Thanks @Isha_99 for such an elaborative explanation and @palashbehra5 for posting this question. Even I was under the same impression as your’s Palash. It helped me get more clarity. :) 4 votes 4 votes Please log in or register to add a comment.