My Suggestion Database Locks


Well-Known Member
A lock is a variable which is link with the data that shows the status of the data with respect to operations performed on it.
changing or manipulating the lock's value is known as locking.
there are two types of lock-
1. exclusive lock
this is called as write lock.this is used to provide use of data item to transaction.
2. shared lock
this is called as read lock. this is used to ensure that data item does not have any changes.

steve taylor

White Belt
Lock are applied on the share data to prevent inconsistency due to concurrent read and write operation performed on the share data.
There are normally two types of locks are acquired by the concurrency controller on the shared data.

Shared lock:-
  • Shared locks are also known as read lock. It acquire on the data when transaction request for read operation.
Exclusive lock :-
  • Exclusive locks are acquire on the shared data when transaction request for read and write the data.


White Belt
Locks are used in the database to prevent inconsistency in the data base. Suppose There are a single file which is shared by two people one is reading the content of the file and another one is perform the update operation on that file. so first user can get different value each time when they read the content of the file. To prevent these situation there are locks are applied to the shared file to achieve consistency.