Recall & Review
beginner
What is a deadlock in a database system?
A deadlock happens when two or more transactions wait forever for each other to release locks, so none can proceed.
Click to reveal answer
beginner
Name one common cause of deadlocks.
Deadlocks often occur when transactions lock resources in different orders, causing a cycle of waiting.
Click to reveal answer
intermediate
How can deadlocks be prevented by ordering resource access?
By always locking resources in the same order, transactions avoid circular waiting and prevent deadlocks.
Click to reveal answer
intermediate
What is the role of a deadlock detection algorithm?
It finds deadlocks when they happen and helps the system choose a transaction to roll back to break the deadlock.
Click to reveal answer
intermediate
Explain how setting a lock timeout helps prevent deadlocks.
If a transaction waits too long for a lock, it times out and rolls back, preventing indefinite waiting and deadlocks.
Click to reveal answer
What causes a deadlock in a database?
✗ Incorrect
Deadlocks occur when transactions wait on each other's locked resources, causing a cycle.
Which method helps prevent deadlocks?
✗ Incorrect
Locking resources in the same order avoids circular waiting and prevents deadlocks.
What does a deadlock detection algorithm do?
✗ Incorrect
It detects deadlocks and chooses a transaction to roll back to break the deadlock.
How does a lock timeout help with deadlocks?
✗ Incorrect
Lock timeout rolls back transactions waiting too long, preventing deadlocks.
Which of these is NOT a deadlock prevention technique?
✗ Incorrect
Ignoring transaction isolation can cause data problems and does not prevent deadlocks.
Describe what a deadlock is and why it happens in databases.
Think about two people blocking each other's way.
You got /3 concepts.
Explain three ways to prevent or handle deadlocks in a database system.
Consider how to avoid waiting cycles or how to break them.
You got /3 concepts.