Before going into details let's know some advantages and disadvantages:
- No Deadlock but two-phase locking have deadlocks.
- Improve in the system efficiency.
- Since unlocking can be done at any time, it reduces the waiting time for other processes who need that data item.
- In case if the transaction is not acquiring its first lock, Extra locks are performed as you have to lock the parent before locking any data item.
- Prior knowledge of the data item.
1. It always performs exclusive locks.
2. first lock by any transaction can be done on any data item even without locking the parent of that data item.
3. In the meantime, after the first lock, to lock any data item, you first need to lock the parent.
3. You can release the locks in any order any time.
4. If a transaction locks a data item 'D' and unlocks it, Then that transaction is is not allowed to lock 'D' again. It means locking and unlocking are only performed at most once on any data item by any transaction.
for Example purposes please refer to the given video.