Please explain. Use the below transaction.
@Shaik Masthan Can you answer this?
@OneZero thats alright. but see the schedule even after applying strict 2pl T1 is reading two different A values.
@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.
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