0 votes 0 votes Please explain. Use the below transaction. Databases transaction-and-concurrency databases two-phase-locking-protocol concurrency + – susgir2 asked Jan 4, 2019 susgir2 1.6k views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply susgir2 commented Jan 4, 2019 reply Follow Share @Shaik Masthan Can you answer this? 0 votes 0 votes Shaik Masthan commented Jan 4, 2019 reply Follow Share i am thinking is this transaction runs without deadlock under strict 2PL ? If there is no deadlock ==> it avoid unrepeatable problem. if deadlock is present ? then what to say ? 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes unrepeatable read happens when a transaction read the value of variable twice or more times and in between these reads other transaction change the value of variable causing different read values for first transaction. so this whole case cant happen in 2PL because no transaction can come in between reads and take exclusive lock for write the value while there is share lock on variable sachin486 answered Nov 24, 2020 sachin486 comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes Any 2 PL if does not cause deadlock will ensure conflict serializability. Now every conflict serializable schedule is free from unrepeatable read problem. So every strict schedule is free from unrepeatable read problem. OneZero answered Jan 4, 2019 OneZero comment Share Follow See all 3 Comments See all 3 3 Comments reply susgir2 commented Jan 4, 2019 reply Follow Share @OneZero thats alright. but see the schedule even after applying strict 2pl T1 is reading two different A values. 0 votes 0 votes OneZero commented Jan 4, 2019 reply Follow Share @susgir2 Is it possible to write the above code in 2PL form? It will cause a deadlock while attempting to perform 2PL. Once deadlock occurs, we can use deadlock handling methods to terminate a transaction When the transaction restarts we will have have a deadlock set of transactions on which we can apply strict 2 PL. 0 votes 0 votes Shivateja MST commented Nov 10, 2019 reply Follow Share How can you conclude every conflict serailizable schedule is free from unrepeatable read problem? 0 votes 0 votes Please log in or register to add a comment.