SlideShare a Scribd company logo
k.Sivapriya
II-M.Sc(IT)
Nadar Saraswathi College Of Arts and Science
Theni
 A deadlock is a condition where two or more
transactions are waiting indefinitely for one
another to give up locks. Deadlock is said to
be one of the most feared complications in
DBMS as no task ever gets finished and is in
waiting state forever.
 For example: In the student table, transaction T1 holds a lock
on some rows and needs to update some rows in the grade
table. Simultaneously, transaction T2 holds locks on some
rows in the grade table and needs to update the rows in the
Student table held by Transaction T1.
 Now, the main problem arises. Now Transaction T1 is waiting
for T2 to release its lock and similarly, transaction T2 is
waiting for T1 to release its lock. All activities come to a halt
state and remain at a standstill. It will remain in a standstill
until the DBMS detects the deadlock and aborts one of the
transactions.

When a database is stuck in a deadlock state, then it is
better to avoid the database rather than aborting or
restating the database. This is a waste of time and
resource.
Deadlock avoidance mechanism is used to detect any
deadlock situation in advance. A method like "wait for
graph" is used for detecting the deadlock situation but
this method is suitable only for the smaller database.
For the larger database, deadlock prevention method
can be used.
 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.
 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.
 The wait for the graph is maintained by the system for
every transaction which is waiting for some data held
by the others. The system keeps checking the graph if
there is any cycle in the graph.
Deadlock prevention method is suitable for a
large database. If the resources are allocated
in such a way that deadlock never occurs,
then the deadlock can be prevented.
The Database management system analyzes the
operations of the transaction whether they
can create a deadlock situation or not. If they
do, then the DBMS never allowed that
transaction to be executed.
 In this scheme, if a transaction requests for a
resource which is already held with a
conflicting lock by another transaction then
the DBMS simply checks the timestamp of
both transactions. It allows the older
transaction to wait until the resource is
available for execution.
 In wound wait scheme, if the older transaction
requests for a resource which is held by the
younger transaction, then older transaction forces
younger one to kill the transaction and release the
resource. After the minute delay, the younger
transaction is restarted but with the same
timestamp.
 If the older transaction has held a resource which
is requested by the Younger transaction, then the
younger transaction is asked to wait until older
releases it.
 Shadow Paging is recovery technique that is used to
recover database. In this recovery technique, database
is considered as made up of fixed size of logical units
of storage which are referred as pages.
 pages are mapped into physical blocks of storage, with
help of the page table which allow one entry for each
logical page of database.
 This method uses two page tables named current page
table and shadow page table.
 The entries which are present in current page table
are used to point to most recent database pages on
disk. Another table i.e., Shadow page table is used
when the transaction starts which is copying current
page table.
 After this, shadow page table gets saved on disk and
current page table is going to be used for transaction.
Entries present in current page table may be changed
during execution but in shadow page table it never
get changed. After transaction, both tables become
identical.

More Related Content

PDF
Apps session wait_tables
PPTX
Business hosting
PDF
Advanced Database Chapter 4.pdf shnsbxlajmndm woweosmkl m,xcnkl C NOOxcx xcbnxc
PDF
Mba ebooks ! Edhole
PDF
Design & Development of an Advanced Database Management System Using Multiver...
PDF
F017213747
PDF
F017213747
DOCX
Dbms voc 5 unit
Apps session wait_tables
Business hosting
Advanced Database Chapter 4.pdf shnsbxlajmndm woweosmkl m,xcnkl C NOOxcx xcbnxc
Mba ebooks ! Edhole
Design & Development of an Advanced Database Management System Using Multiver...
F017213747
F017213747
Dbms voc 5 unit

Similar to Deadlock and shadow paging (20)

PDF
Concurrency control
PDF
Unit 5 rdbms study_material
PPT
Concurrency control ms neeti
PPT
Concurrency control ms neeti
PPTX
Deadlock in database
PPT
Lecture 5 Deadlocks in Database Systems.ppt
PPTX
Vani dbms
PPTX
Transaction and NOSQL Chapter-Module 5.pptx
PPTX
DBMS (Deadlock, deadlock prevention, 2phase locking)
PDF
Concurrency note.pdf
PPTX
Os presentation final.pptxjjjjjdakajwsjjdhdfjff
PPTX
Transaction management
PPTX
Rt databases vs general purpose tsp
PPT
Real time database
PPT
Concurrency Control power point presentations.ppt
PPTX
Understanding Transactions in Databases.pptx
PDF
Distributed deadlock
Concurrency control
Unit 5 rdbms study_material
Concurrency control ms neeti
Concurrency control ms neeti
Deadlock in database
Lecture 5 Deadlocks in Database Systems.ppt
Vani dbms
Transaction and NOSQL Chapter-Module 5.pptx
DBMS (Deadlock, deadlock prevention, 2phase locking)
Concurrency note.pdf
Os presentation final.pptxjjjjjdakajwsjjdhdfjff
Transaction management
Rt databases vs general purpose tsp
Real time database
Concurrency Control power point presentations.ppt
Understanding Transactions in Databases.pptx
Distributed deadlock
Ad

More from Siva Priya (12)

PPTX
source code metrics and other maintenance tools and techniques
PPTX
Class properties
PPTX
Planning the development process
PPTX
recovery management with concurrent controls
PPTX
Web technology
PPTX
Retail of big data analytics
PPT
Mobile IP
PPTX
density based method and expectation maximization
PPTX
Classification by backpropacation
PPTX
Disk scheduling & Disk management
PPTX
Routing algorithm
PPTX
Servlets & jdbc
source code metrics and other maintenance tools and techniques
Class properties
Planning the development process
recovery management with concurrent controls
Web technology
Retail of big data analytics
Mobile IP
density based method and expectation maximization
Classification by backpropacation
Disk scheduling & Disk management
Routing algorithm
Servlets & jdbc
Ad

Recently uploaded (20)

PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
Tartificialntelligence_presentation.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
cuic standard and advanced reporting.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Approach and Philosophy of On baking technology
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Encapsulation theory and applications.pdf
PPTX
Spectroscopy.pptx food analysis technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Getting Started with Data Integration: FME Form 101
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
NewMind AI Weekly Chronicles - August'25-Week II
Tartificialntelligence_presentation.pptx
Network Security Unit 5.pdf for BCA BBA.
MIND Revenue Release Quarter 2 2025 Press Release
Spectral efficient network and resource selection model in 5G networks
cuic standard and advanced reporting.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Encapsulation_ Review paper, used for researhc scholars
Approach and Philosophy of On baking technology
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Encapsulation theory and applications.pdf
Spectroscopy.pptx food analysis technology
Building Integrated photovoltaic BIPV_UPV.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
20250228 LYD VKU AI Blended-Learning.pptx
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Reach Out and Touch Someone: Haptics and Empathic Computing
The Rise and Fall of 3GPP – Time for a Sabbatical?
Getting Started with Data Integration: FME Form 101
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

Deadlock and shadow paging

  • 2.  A deadlock is a condition where two or more transactions are waiting indefinitely for one another to give up locks. Deadlock is said to be one of the most feared complications in DBMS as no task ever gets finished and is in waiting state forever.
  • 3.  For example: In the student table, transaction T1 holds a lock on some rows and needs to update some rows in the grade table. Simultaneously, transaction T2 holds locks on some rows in the grade table and needs to update the rows in the Student table held by Transaction T1.  Now, the main problem arises. Now Transaction T1 is waiting for T2 to release its lock and similarly, transaction T2 is waiting for T1 to release its lock. All activities come to a halt state and remain at a standstill. It will remain in a standstill until the DBMS detects the deadlock and aborts one of the transactions. 
  • 4. When a database is stuck in a deadlock state, then it is better to avoid the database rather than aborting or restating the database. This is a waste of time and resource. Deadlock avoidance mechanism is used to detect any deadlock situation in advance. A method like "wait for graph" is used for detecting the deadlock situation but this method is suitable only for the smaller database. For the larger database, deadlock prevention method can be used.
  • 5.  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.
  • 6.  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.  The wait for the graph is maintained by the system for every transaction which is waiting for some data held by the others. The system keeps checking the graph if there is any cycle in the graph.
  • 7. Deadlock prevention method is suitable for a large database. If the resources are allocated in such a way that deadlock never occurs, then the deadlock can be prevented. The Database management system analyzes the operations of the transaction whether they can create a deadlock situation or not. If they do, then the DBMS never allowed that transaction to be executed.
  • 8.  In this scheme, if a transaction requests for a resource which is already held with a conflicting lock by another transaction then the DBMS simply checks the timestamp of both transactions. It allows the older transaction to wait until the resource is available for execution.
  • 9.  In wound wait scheme, if the older transaction requests for a resource which is held by the younger transaction, then older transaction forces younger one to kill the transaction and release the resource. After the minute delay, the younger transaction is restarted but with the same timestamp.  If the older transaction has held a resource which is requested by the Younger transaction, then the younger transaction is asked to wait until older releases it.
  • 10.  Shadow Paging is recovery technique that is used to recover database. In this recovery technique, database is considered as made up of fixed size of logical units of storage which are referred as pages.  pages are mapped into physical blocks of storage, with help of the page table which allow one entry for each logical page of database.  This method uses two page tables named current page table and shadow page table.
  • 11.  The entries which are present in current page table are used to point to most recent database pages on disk. Another table i.e., Shadow page table is used when the transaction starts which is copying current page table.  After this, shadow page table gets saved on disk and current page table is going to be used for transaction. Entries present in current page table may be changed during execution but in shadow page table it never get changed. After transaction, both tables become identical.