0% found this document useful (0 votes)
9 views

CS 3306 Written Assignment Unit 2

Deadlocks in database management systems occur when transactions hold resources needed by others, leading to a cycle of waiting. Recovery involves selecting a victim transaction to roll back, executing the rollback, and preventing starvation by ensuring fairness in transaction execution. By implementing these strategies, database systems can maintain consistency and avoid performance degradation.

Uploaded by

idonijejeffreyy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

CS 3306 Written Assignment Unit 2

Deadlocks in database management systems occur when transactions hold resources needed by others, leading to a cycle of waiting. Recovery involves selecting a victim transaction to roll back, executing the rollback, and preventing starvation by ensuring fairness in transaction execution. By implementing these strategies, database systems can maintain consistency and avoid performance degradation.

Uploaded by

idonijejeffreyy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Deadlock Detection and Recovery

Introduction

Deadlocks occur in database management systems (DBMS) when multiple transactions hold

resources that others need, leading to a cycle of waiting that prevents further progress. When a

detection algorithm identifies a deadlock, the system must take corrective actions to recover. The

most common method is rolling back one or more transactions to break the deadlock

(Silberschatz, Korth, & Sudarshan, 2001). Figure 16.19 from Database System Concepts outlines

three essential actions required for deadlock recovery.

Three Actions for Deadlock Recovery

1. Selecting the Victim

The system must choose which transaction(s) to roll back to resolve the deadlock. This

selection is based on factors such as transaction priority, execution time, and the number

of resources held. A transaction that has performed minimal work or has lower priority is

typically chosen as the victim to minimize rollback costs.

2. Rollback Execution

Once the victim is identified, the system must decide whether to perform a partial or

total rollback.

○ Partial rollback undoes only the latest operations, allowing the transaction to

restart from a safe point.


○ Total rollback cancels the entire transaction, requiring it to start from the

beginning.

The choice between these methods depends on the impact of rollback on system

performance and data consistency.

3. Preventing Starvation

Starvation occurs when the same transaction is repeatedly chosen as the victim,

preventing it from completing. To avoid this, the system may implement a wait-time

priority scheme, ensuring older transactions have a lower chance of being aborted

repeatedly. This guarantees fairness in transaction execution and prevents indefinite

delays.

Discussion of Figure 16.19

Figure 16.19 illustrates the deadlock recovery process in a DBMS. It visually represents how

transactions are identified, evaluated, and rolled back systematically to break the deadlock cycle.

The figure emphasizes the importance of transaction selection and rollback strategy to ensure

minimal disruption to the database system while resolving the deadlock efficiently.

Conclusion

Deadlocks are an unavoidable challenge in concurrent database systems. When detected, the

system must take strategic recovery actions: selecting an appropriate victim, executing a rollback

effectively, and implementing starvation prevention mechanisms. By following these steps,

database systems can maintain consistency and ensure smooth transaction processing without

unnecessary performance degradation.


References

Silberschatz, A., Korth, H. F., & Sudarshan, S. (2001). Database System Concepts (4th ed.). New

York, NY: McGraw-Hill.

You might also like