Types of Deadlocks in SQL Server
-
Please help me out, what are the types of deadlocks in SQL Server; and how are the ways to solve it?
Regards, John.L.Ponratnam
-
Please help me out, what are the types of deadlocks in SQL Server; and how are the ways to solve it?
Regards, John.L.Ponratnam
I can only think of one type of deadlock, meaning that 2 or more processes are trying to get to the same set of resources. There are however many type of "Locks". 1) Shared locks 2) Exclusive locks 3) Update locks 4) Intent locks Here is how a deadlock can occur: Process 1 Locks resource A Looking to lock resource B Process 2 Locks resource B Looking to lock resource A Classic deadlock situation. The way to avoid this is to lock the resources in the same order, this way process 1 & 2 would never be able to lock each other out. Either process 1 or proccess 2 would be granted resource A, then lock resource B and continue on. Most database engines solve the deadlock issue by choosing a "victim" and forcing a rollback of the transaction, thus releasing the locks owned by it. Typically once the victim has been choosen, the remaining processes can continue on with their work.
-
Please help me out, what are the types of deadlocks in SQL Server; and how are the ways to solve it?
Regards, John.L.Ponratnam
-
Please help me out, what are the types of deadlocks in SQL Server; and how are the ways to solve it?
Regards, John.L.Ponratnam