Instructions:
Please submit the answers to the following questions in a Microsoft Word document.
This assignment verifies that you understand how shared and exclusive locks work. Suppose that S1, S2, and S3 are sessions connected concurrently to the same database instance. Suppose further that D1, D2, and D3 are data objects that can be locked with a shared and exclusive lock. For the ten locking situations below, indicate, for each session, whether it procures the requested lock, waits, or deadlocks.
1. S1 has a shared lock on D1 and S2 attempts to procure a shared lock on D1. S2 can procure a shared lock on D1
2. S1 has an exclusive lock on D1 and S2 attempts to procure a shared lock on D1. S2 has to wait until S1 releases exclusive lock on D1
3. S1 has a shared lock on D1 and S2 attempts to procure an exclusive lock on D1. S2 must wait until S1 commits in order to procure an exclusive lock on D1
4. S1 has an exclusive lock on D1 and S2 attempts to procure an exclusive lock on D1. S2 must wait to begin until S1 commits in order to procure an exclusive lock on D1
5. S1 has a shared lock on D1, S2 has a shared lock on D1, and S3 attempts to procure a shared lock on D1. S3 can procure a shared lock on D1.
6. S1 has an exclusive lock on D1 and a shared lock on D2, and S2 attempts to procure an exclusive lock on D2. S2 must wait until S1 unlocks D2 in order to procure an exclusive lock on D2.
7. S1 has a shared lock on D1 and a shared lock on D2, and S2 attempts to procure a shared lock on D2. S2 can procure a shared lock on D2.
8. S1 has a shared lock on D1 and a shared lock on D2. S2 has a shared lock on D2 and attempts to procure an exclusive lock on D1. S2 must wait until S1 unlocks D1in order to procure an exclusive lock on D1
9. S1 has an exclusive lock on D1 and is waiting for an exclusive lock on D2. S2 has an exclusive lock on D2 and is waiting for an