ITPEC FE Subject A April 2024 Question 22
Which of the following can change the deadlock state of the transaction back to the normal state?
Explanation
Rollback — undoing one of the deadlocked transactions releases its locks so the others can continue.
In a deadlock, two or more transactions each hold a lock the other is waiting for, so none can proceed. The DBMS detects the cycle, picks a victim transaction and rolls it back: its updates are undone using the before-images in the log and its locks are released. The remaining transactions then get their locks and run normally, and the victim can be restarted.
Answer (c)
Why not others:
- •(a) Commit — a deadlocked transaction is waiting for a lock and cannot reach its commit; commit only ends a transaction that has finished its work
- •(b) Drop — a DDL statement that deletes a database object such as a table; it has nothing to do with transaction control
- •(d) Roll Forward — reapplies committed updates from the log (after-images) to a restored backup after a media failure; it redoes work rather than breaking a lock wait
Key rule: Rollback undoes an unfinished transaction with before-images (deadlock, transaction failure); roll forward redoes committed ones with after-images (media failure).
Databases · AI-written, may contain errors
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.