DSA Factory
Free Transactions and concurrency lessonsTransactions and concurrency · Stage 2 · Control and recovery · Step 1

Locks and two-phase locking

See how shared and exclusive locks, taken in two phases, guarantee serializable schedules. About 14 minutes.

Quick check

Which of these breaks the rule of two-phase locking?

  1. AA transaction releases a lock and then acquires a new lock
  2. BA transaction acquires many locks one after another
  3. CTwo transactions hold shared locks on the same item
Show the answer

A transaction releases a lock and then acquires a new lock. Once it has entered the shrinking phase, it may only release.

Lock it in

4 questions on this idea

Short questions that apply the idea to new cases: trace it, work out a number, put steps in order. A wrong answer explains itself.

Answer them in your browserFree account, no card. Your progress is saved, and the idea comes back in a quick review later.
Sign up free to solve