Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

How are locks used in lock based concurrency control?


Asked by Everest Cabrera on Dec 01, 2021 FAQ



A transaction in any system implementing lock based concurrency control cannot read or write a statement until it has obtained the required locks. There are two types of locks in Lock based protocols. These are: Binary Locks - These can only be in one of two states, locked or unlocked.
Besides,
A lock is a variable associated with a data item that describes a status of data item with respect to possible operation that can be applied to it. They synchronize the access by concurrent transactions to the database items. It is required in this protocol that all the data items must be accessed in a mutually exclusive manner.
Keeping this in consideration, There are three concurrency control techniques which are as follows: Database systems equipped with lock-based protocols use a mechanism by which any transaction cannot read or write data until it acquires an appropriate lock on it. • Binary Locks − A lock on a data item can be in two states; it is either locked or unlocked.
And,
Some of the main techniques used to control concurrent execution of transactions are based on the concept of locking data items. A lock is a variable associated with a data item that describes the status of the item with respect to possible operations that can be applied to it. Generally, there is one lock for each data item in the data-base.
Just so,
Locks are an integral part to maintain concurrency control in DBMS. A transaction in any system implementing lock based concurrency control cannot read or write a statement until it has obtained the required locks. There are two types of locks in Lock based protocols.