Questions tagged [deadlock-graph]

21 questions
7
votes
1 answer

SQL Server Deadlock between two selects and one update on one table

Our application encounters a deadlock every now and again (about once a week). The main culprit seems to be a query with two selects. One of them is to fill a temp table for performance reasons, the other is a relatively complex select with many…
final
  • 335
  • 2
  • 11
6
votes
1 answer

Deadlock Graph - Surviving Statement inputbuf does not show the object that was locked

I have captured a deadlock on my system and the (anonymised) XML output is as follows:
SE1986
  • 2,142
  • 4
  • 30
  • 61
4
votes
1 answer

What does exchangevent indicate in SQL deadlock graph?

Have a deadlock XDL file with several exchange events listed. Not sure if these are good or bad or what causes them. What causes exchange events in SQL deadlock graph?
user2368632
  • 1,133
  • 1
  • 15
  • 33
3
votes
1 answer

Deadlock on DELETE - DELETE for parallel execution of same stored procedure

I have a stored procedure which ran parallely by two processes. Code for sp : DECLARE @inputXML XML DECLARE @tempTable TABLE (afid INT, ccid INT) INSERT INTO @tempTable SELECT ref.value('@afid', 'INT'),ref.value('@ccid', 'INT') FROM…
Himanshuman
  • 197
  • 1
  • 10
2
votes
1 answer

How to resolve linenumber in deadlock graph XML to line number displayed in SSMS sproc definition?

Captured the XML graph for a given deadlock involving some large / multi query sp's. However, not really sure how to interpret the line, stmtstart, stmtend of the frame element to determine which line of sproc TSQL encountered the deadlock. Line…
user2368632
  • 1,133
  • 1
  • 15
  • 33
2
votes
0 answers

Unhandled Deadlocks with SQL Server 2017

We’re running into issues with unresolved deadlocks on the most recent version of SQL-Server 2017, has anybody seen a problem like this before? Detailed explanation: We migrated our database from Sybase-ASE to SQL Server 2017 (RTM-CU23) two weeks…
2
votes
1 answer

Postgres 9.5 deadlock with many updates on a table + many "select for update" on another table

I have two tables: "machines" and "magictools". "magictools" refers to "machines" with a foreign key. I face a deadlock problem while executing many of these requests: //this will produce an "AccessExclusiveLock" of type "tuple" on machines SELECT…
Slim
  • 291
  • 3
  • 15
1
vote
0 answers

Same update on different rows results in deadlocking

We are testing our SQL Server database for concurrency issues and it appears that a single, simple update statement being run concurrently in transactions is resulting in deadlocks. Here is the statement: (@Version nvarchar(7),@TestAttemptId…
1
vote
1 answer

Why my clustered index causing deadlock (Keylocks and Pagelocks)

We are experiencing deadlock 2-3 times a day in SQL Server. Upon analysis, we have found that the deadlock is caused by a combination of keylock and pagelock occurring simultaneously. We are actually using EF to fetch data and the query involves…
1
vote
1 answer

Why is my non clustered index causing this deadlock?

I have an application that runs the following query in multiple parallel threads: update Table1 SET Col1 = 'Some value' WHERE Order_ID = @orderID Order_ID is NOT the primary key on this table, but the @orderID is different for each thread, this…
Eduardo Wada
  • 154
  • 1
  • 7
1
vote
0 answers

What is the object involved in an Object Lock in SQL Server Profiler's Deadlock graph?

In searching documentation online, I have found that there can be row, page, or table locks. However, I ran a SQL Server Profiler trace and noticed both a Page Lock and an Object lock. I can easily discern the table involved in the Page lock from…
Paradox
  • 155
  • 6
1
vote
2 answers

SQL Server - Exclusive lock taken by a SELECT statement - Why?

I'm trying to make sense of why SQL Server (2014) is placing an eXclusive key lock during a deadlock scenario. I've pasted the entire deadlock graph below. I'm confused because the deadlock is happening between two SELECT statements, both running as…
FrugalShaun
  • 441
  • 3
  • 11
1
vote
1 answer

Deadlock Detection | Should the node T4 point to T1 and T2?

This example regarding deadlock detection was shown during one of my lectures and I have a doubt about it. The image is shown below. For deadlock detection mechanism, why does T4 point only to T2 and not T1? Chronologically, T1 requests for the…
Jalansh
  • 13
  • 2
1
vote
1 answer

Purging SP getting deadlocked with App...Not able to completed understand Deadlock Graph

We have a stored procedure which purges old data. On a regular basis, it is getting deadlocked with an application stored procedure. Below is the deadlock graph: Deadlock XML:
1
vote
1 answer

Why is a Shared lock blocking on an IX lock when Read Committed Snapshot is enabled?

Our system has randomly started deadlocking in areas where it previously had not, and an analysis of the deadlock graph looks like it should not even be happening to begin with. Here is a screenshot of the deadlock graph. For reference: The left…
Mirrana
  • 224
  • 1
  • 10
1
2