Deadlock handling is costly as well as time-consuming. So DBMS inspects the transactions to determine any possibility of any deadlock occurring and effectively removes such scenarios by not letting the particular transaction be executed.
There are four approaches to dealing with deadlocks:
- Deadlock Prevention
- Deadlock avoidance (Banker’s Algorithm)
- Deadlock detection and recovery
- Ignoring deadlocks altogether