Week7 - Locking Protocols, Two Phase Locking, Deadlock / Assess

The questions can come in any order, so make sure you are selecting right option for all questions.

1. In the context of locking, what does the term "lock contention" refer to?

(c) The conflict between transactions competing for the same locks

2. Transaction T1 holds a shared lock on Resource X, and Transaction T2 holds an update lock on the same resource. If T1 requests an update lock on Resource X, what will happen?

(d) T1 will be blocked until T2 releases the update lock

3. Transaction T1 holds a shared lock on a resource, and T2 holds an exclusive lock on the same resource. What is the likely outcome if T1 requests an exclusive lock on the resource?

(a) T1 will be blocked until T2 releases the lock

4. Consider two transactions T1 and T2. If T1 has acquired a shared lock on a resource, what action can T2 perform on the same resource?

(b) Acquire a shared lock

5. Transaction T1 has acquired a shared lock on Resource A, and Transaction T2 has acquired an exclusive lock on Resource B. If T1 now requests an exclusive lock on Resource B, and T2 requests a shared lock on Resource A, what will happen?

(b) Both requests will be denied

6. What is the purpose of the Growing Phase in the Two-Phase Locking protocol?

(c) Transactions can acquire new locks but cannot release any

7. What type of lock allows multiple transactions to read a resource simultaneously but prevents any of them from updating it?

(a) Shared Lock

8. Which lock type is used when a transaction wants to both read and update a resource in a way that prevents other transactions from updating it concurrently?

(c) Update Lock

9. In a database system following the Two-Phase Locking protocol, what is the purpose of the Growing Phase?

(b) Transactions can acquire new locks but cannot release any

10. In a deadlock situation, what is a possible strategy to resolve it using the Wait-Die mechanism?

(a) The younger transaction waits

11. If a transaction holds an exclusive lock on a resource, what can other transactions do with the same resource?

(d) None of the above

12. Transaction T1 holds an exclusive lock on a resource. What will happen if T2 requests a shared lock on the same resource?

(a) T2 will be blocked until T1 releases the lock

13. If a transaction is in the Shrinking Phase of the Two-Phase Locking protocol, what does it mean?

(b) The transaction is releasing locks

14. How can a database system typically detect a deadlock situation?

(a) Timeout mechanism

15. What mechanism is often used to detect and resolve deadlocks in database systems?

(b) Wait-Die mechanism

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.