Practice mode DBMS and SQL

T1 holds a shared (S) lock on item X. T2 now requests an exclusive (X) lock on the same item. What happens under standard lock compatibility?

Correct answer B. T2 must wait until T1 releases its shared lock

Explanation

Shared locks are compatible only with other shared locks, so several readers can hold S locks on an item together. An exclusive lock is compatible with nothing, because a writer needs sole access. T2's request conflicts with T1's S lock, so T2 waits. Had T2 asked for another S lock, it would have been granted at once.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.