0% found this document useful (0 votes)
25 views7 pages

12-DBMS - Deadlock Handling

Deadlocks in a DBMS occur when transactions wait indefinitely for each other to release locks. Deadlock detection involves using a Wait for graph to identify cycles indicating a deadlock, while handling methods include prevention by violating certain properties and recovery through strategies like Wait-Die and Wound-Wait. These approaches help manage and resolve deadlocks effectively in database systems.

Uploaded by

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

12-DBMS - Deadlock Handling

Deadlocks in a DBMS occur when transactions wait indefinitely for each other to release locks. Deadlock detection involves using a Wait for graph to identify cycles indicating a deadlock, while handling methods include prevention by violating certain properties and recovery through strategies like Wait-Die and Wound-Wait. These approaches help manage and resolve deadlocks effectively in database systems.

Uploaded by

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

DBMS: Deadlock Handling

Akhilesh Arya
Deadlock in DBMS
• A deadlock is a condition where two or more
transactions are waiting indefinitely for one
another to give up locks
Deadlock Detection
• In a database, when a transaction waits
indefinitely to obtain a lock, then the
DBMS should detect whether the
transaction is involved in a deadlock or not
• The lock manager maintains a Wait for
the graph to detect the deadlock cycle in
the database
Wait for Graph
• This is the suitable method for deadlock detection
• In this method, a graph is created based on the
transaction and their lock
• If the created graph has a cycle or closed loop,
then there is a deadlock
Deadlock Handling
• There are 2 methods of deadlocking
handling:
– Deadlock Prevention
– Detection and Recovery
Deadlock Prevention
• Violate the properties such as mutual
exclusion, Hold and Wait, Preemption
and circular weight
• If none or one of the property is not
present in the transaction then
definitely we can prevent deadlock
Deadlock Recovery
• Wait- Die (Non- Preemptive)
– If TS(Ti) < TS(Tj) then Ti must wait (Ti is older)
– If TS(Ti) > TS(Tj) then Ti rollback (Die)
• Wound- Wait (Preemptive)
– If TS(Ti) > TS(Tj) then Ti can wait (Ti is yonger)
– If TS(Ti) < TS(Tj) then Tj rollback (Die)

You might also like