Question

Give an example of a locking scheme that doesn’t guarantee serializability? (Not strict or regular Two...

Give an example of a locking scheme that doesn’t guarantee serializability? (Not strict or regular Two phase locking). And if you could explain your thinking that would be helpful!
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Consider the locking scheme just like two phase locking scheme in which exclusive lock(X) is acquired on data for writing purpose and shared lock(S) is acquired for reading purpose on data. But the difference with our scheme from Two phase locking scheme is that unlike in Two phase locking scheme where one phase is lock acquiring phase in which before performing the transaction, it acquires appropriate locks on data it use for read or write purpose and then in second phase it release the lock it had acquire after performing all operation and hence complete the transaction, in our scheme, the lock acquired on a data will be for a particular time of transaction only and immediately we will release the lock once the variable is of no use after that, even through some of the operations in transaction yet to be done on other data.

So, now in this scenario, we will give example of non-serializable schedule.

T1 T2
X(A)
A = A+ 10
Release A
S(A)
Read A
Release A
X(B)
B = B*5
Release B
S(B)
Read B
Release B
Complete T1 Complete T2

We can see that above schedule is not serializable because T1 has performed modification on data A before being read by T2 and T2 has performed modification on data B which is being read by T1. Hence above locking scheme is not serializable.

Please comment for any clarification.

Add a comment
Know the answer?
Add Answer to:
Give an example of a locking scheme that doesn’t guarantee serializability? (Not strict or regular Two...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT