Correct option is A
A
shared lock is used in database systems to allow multiple transactions to
read the same data simultaneously without interference. However,
write operations are restricted to maintain consistency and prevent conflicts.
Important Key Points:
1. A
shared lock ensures that data can be read by multiple transactions at the same time without allowing any of them to modify it.
2. If one transaction holds a
shared lock, other transactions can also acquire shared locks on the same data.
3. To write data, a transaction must acquire an
exclusive lock, which prevents others from accessing the data.
4. Shared locks are part of the
locking mechanism used in
concurrency control to maintain database integrity.
Knowledge Booster:
·
Exclusive Lock: Prevents other transactions from both reading and writing to the data. Used when a transaction intends to modify data.
·
Deadlock: A situation that can occur in locking mechanisms when two or more transactions wait for each other's locks to release.
·
Two-Phase Locking Protocol: A concurrency control method that ensures serializability by acquiring all locks before releasing any.