Concept Flow - Deadlock detection and prevention
Transaction A requests Lock on Resource 1
Transaction B requests Lock on Resource 2
Transaction A requests Lock on Resource 2
Transaction B requests Lock on Resource 1
Deadlock detected by system
System chooses a victim transaction to rollback
Victim transaction rolled back, locks released
Other transaction proceeds
Deadlock resolved
Transactions request locks on resources; if each waits for the other, a deadlock occurs. The system detects this cycle and aborts one transaction to resolve it.