465 views

1 Answer

2 votes
2 votes
try inserting locks such that before read u need S-lock on that variable and before Write u need X-lock on that variable if u get combination of locks which follows 2PL i.e. after unlocking a lock transaction won’t acquire another lock then it follows 2PL.

NOTE:- normal 2PL doesn’t support upgrade or downgrade so if u need to read and later write on variable ‘A’ then u have to acquire X-lock(A) before read since you won’t be able to upgrade from S-lock to X-lock

Related questions

1 votes
1 votes
2 answers
1
8 votes
8 votes
2 answers
4