Recall & Review
beginner
What is a deadlock in a database system?
A deadlock occurs when two or more transactions wait indefinitely for each other to release locks on resources, causing all involved transactions to stop progressing.
Click to reveal answer
intermediate
Name one common method used to detect deadlocks in databases.
One common method is the wait-for graph, where transactions are nodes and edges represent waiting for locks. A cycle in this graph indicates a deadlock.
Click to reveal answer
intermediate
What is deadlock prevention in databases?
Deadlock prevention involves designing the system to avoid conditions that can cause deadlocks, such as by ordering resource requests or using timeouts.
Click to reveal answer
intermediate
How does deadlock resolution typically work in databases?
Deadlock resolution usually involves choosing one transaction as a victim and rolling it back to break the deadlock, allowing other transactions to continue.
Click to reveal answer
beginner
Why is deadlock handling important in database management?
Deadlock handling is important to ensure that transactions do not get stuck forever, which would block other operations and reduce system performance and reliability.
Click to reveal answer
What indicates a deadlock in a wait-for graph?
✗ Incorrect
A cycle in the wait-for graph means transactions are waiting on each other in a loop, which is a deadlock.
Which of the following is NOT a deadlock handling technique?
✗ Incorrect
Ignoring deadlocks is not a handling technique because it causes the system to hang indefinitely.
What action is taken to resolve a deadlock?
✗ Incorrect
Rolling back one or more transactions breaks the deadlock cycle and allows others to proceed.
Deadlock prevention can be achieved by:
✗ Incorrect
Requesting locks in a fixed order prevents circular wait, a necessary condition for deadlocks.
Why is deadlock detection preferred over prevention in some systems?
✗ Incorrect
Prevention techniques can limit how transactions access resources, reducing system concurrency and performance.
Explain what a deadlock is in a database and why it happens.
Think about transactions waiting for locks held by each other.
You got /3 concepts.
Describe the main strategies used to handle deadlocks in databases.
Consider how systems avoid, find, or fix deadlocks.
You got /4 concepts.