Locking
1. What is Locking?
Answer:
Locking is a type of protocol where each and every operation has to be locked before the transaction and must be released or made free after the completion of tasks and it should happen with each data item.
2. Why is Locking Needed in DBMS?
Answer:
Locking is basically a protocol used for controlling concurrency. Lock provides a way to handle transaction requests.
3. What Are the Problems Associated with Lock-based Protocols?
Answer:
The problem associated with the lock-based protocol is the possibility of deadlock and these deadlocks are unavoidable.
Implementation of Locking in DBMS
Locking protocols are used in database management systems as a means of concurrency control. Multiple transactions may request a lock on a data item simultaneously. Hence, we require a mechanism to manage the locking requests made by transactions. Such a mechanism is called a Lock Manager. It relies on the process of message passing where transactions and lock manager exchange messages to handle the locking and unlocking of data items.