What are the Deadlock handling techniques in database?
A set of transactions are considered to be in a deadlock state, if the transactions are waiting for one another to release the data items needed for them that are held by others. In a deadlock state no transaction will proceed.
The deadlock can be handled by rolling back a transaction which would be chosen as the victim.
Deadlock can
be handled in the following ways;
Deadlock Prevention – this concept ensures that the system never enters a deadlock state. It chooses the transaction which would probably cause the deadlock and rolls-back the transaction.
Deadlock Detection – this identifies the deadlock if any happened and recovers the
system from deadlock.
Deadlock Recovery - recovers the system from deadlock state. It chooses the identified transaction which caused the deadlock, and rolls-back it.
Related Links
Deadlock in databaseDatabase management systems home page
Four necessary conditions for deadlock to happen