© Dmitri Korotkevitch 2018
Dmitri KorotkevitchExpert SQL Server Transactions and Lockinghttps://doi.org/10.1007/978-1-4842-3957-5_5

5. Deadlocks

Dmitri Korotkevitch1 
(1)
Land O Lakes, Florida, USA
 

A deadlock is a special blocking case that occurs when multiple sessions—or sometimes multiple execution threads within a single session—block each other. When it happens, SQL Server terminates one of the sessions, allowing the others to continue.

This chapter will demonstrate why deadlocks occur in the system and explain how to troubleshoot and resolve them.

Classic Deadlock

A classic deadlock occurs when two or more sessions are competing for the same set of resources. Let’s look at a by-the-book example and assume that you have two sessions updating two ...

Get Expert SQL Server Transactions and Locking: Concurrency Internals for SQL Server Practitioners now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.