How does deadlock happen




















Parent topic: Locking, concurrency, and isolation. Related concepts Isolation levels and concurrency. Configuring isolation levels. Lock granularity. And no one is releasing any resource. So, both are waiting for each other to release the resource.

This leads to infinite waiting and no work is done here. This is called Deadlock. Let's take one real-life example to understand the concept of Deadlock in a better way. Suppose, you are studying in a school and you are using the bus service also.

So, you have to pay two fees i. Now, think of a situation, when you go for submitting the bus fee and the accountant says that you have to submit the tuition fee first and then the bus fee. So, you go to submit the tuition fees on the other counter and the accountant there said that you have to first submit the bus fees and then the tuition fees. So, what will you do here?

You are in a situation of deadlock here. You don't know what to submit first, bus fees or tuition fees? Using extended events you will be able to see quite easily how frequently deadlocks occur in your database, and immediately have the deadlock graph available for each deadlock which occurred in order to help you resolve it.

First, get all the information you need and then submit the transaction. Look out for my next articles which explain how to read the deadlock graph which is the most useful in understanding the cause of your deadlock and will give you the insight on how to tackle a deadlock.

Author Recent Posts. Minette Steynberg. View all posts by Minette Steynberg. Latest posts by Minette Steynberg see all. The end is nigh! This is the default priority. Improve Article. Like Article.

Attention reader! Recommended Articles. Article Contributed By :. Easy Normal Medium Hard Expert. Writing code in comment?



0コメント

  • 1000 / 1000