Regarding the Two-Phase Locking protocol used in transactions, it is said in some websites that this protocol guarantees serializability. I tried to find examples and more on how it guarantees serialisability but could not find. Alll I found is the rules which are:
1.Two transactions cannot have conflicting locks
2.No UNLOCK operation can precede a LOCK operation in the same transaction.
3.No data are affected until all locks are obtained—that is, until transaction is in its locked point
I need to understand how this protocol guarantees serializability and how deadlock can happen in 2 PL.
if you have examples please post them