What happens in the growing stage of two-phase locking?
- The transaction collects every lock it needs and releases none
- The transaction releases locks and takes no new ones
- The transaction runs with no locks at all
What does isolation promise?
- Every transaction runs truly alone on its own machine
- Each transaction behaves as if it has the database all to itself
- Transactions may freely mix their changes together
Under snapshot isolation, a transaction reads from the picture taken when it started, no matter what others commit meanwhile.
Circle one: True False
Two transactions each hold a lock the other wants. What happens next?
- Both finish at double speed
- Neither moves, and the system cancels one side
- Both automatically share the locks
Why must a transaction not release a lock early and take another one later?
- Another transaction could slip a change in between
- Locks can never be released at all
- Early release always crashes the database
What price does the database pay for offering snapshots?
- Keeping old row versions around for open pictures
- Blocking every writer during long reports
- Deleting all pictures once a day
A friend says snapshots make all conflicts impossible. What is the best reply?
- Correct, pictures remove every clash
- Wrong for locks, but locks never wait either
- Wrong, same-row writes from one picture still clash at commit
Two transactions change the same row starting from the same picture. What must the system do at commit?
- Accept both writes quietly
- Delete the row entirely
- Catch the clash and let only one win