Question:

Assume transaction A holds a shared lock R. If transaction B also requests for a shared lock on R, it will

Show Hint

Shared locks allow multiple transactions to read the same resource concurrently, but any exclusive lock or write operation is not allowed until all shared locks are released.
Updated On: May 4, 2025
  • Immediately be rejected
  • Result in a deadlock situation
  • Immediately be rejected
  • Be granted as soon as it is released by A
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is D

Solution and Explanation

- Option 1: The shared lock is not rejected as both transactions are requesting read access (shared locks), so there is no conflict.
- Option 2: There is no deadlock situation in this scenario. Deadlocks usually happen when one transaction is waiting for a resource held by another transaction in an incompatible mode (like exclusive locks).
- Option 3: Shared locks are not immediately rejected. Multiple transactions can hold shared locks on the same resource.
- Option 4: This is correct. A shared lock allows other transactions to request shared locks on the resource, and it will be granted once transaction A releases the lock.
Therefore, the correct answer is 4. Be granted as soon as it is released by A.
Was this answer helpful?
0
0