Note that there are some explanatory texts on larger screens.

plurals
  1. PORangeS-U and U locks at the same time and on the same resource
    primarykey
    data
    text
    <p>I'm working with some stored procedure and deadlock situation.</p> <p>I've been using SQL Server Profiler and get some information about the deadlock from 'Deadlock graph' event in form of the .xdl file. Below content of that file.</p> <p>I've just cleared some informations about the statement.The statement marked as <code>&lt;executionStack&gt;</code> in the .xdl was something like this (for both processes the same statement):</p> <pre><code>SELECT SomeColumn, SomeColumn2 FROM SomeTable WITH (UPDLOCK) INNER JOIN SomeTable2 ON SomeTable.SomeTable2ID = SomeTable2.SomeTable2ID INNER JOIN SomeTable3 ON SomeTable2.SomeTable3ID = SomeTable3.SomeTable3ID WHERE SomeColumn = @Something AND SomeColumn2 = @Something2 </code></pre> <p>And the content of the .xdl file:</p> <pre><code>&lt;deadlock-list&gt; &lt;deadlock victim="processc19dc8"&gt; &lt;process-list&gt; &lt;process id="processc19dc8" taskpriority="0" logused="0" waitresource="KEY: 5:72057594042646528 (8194443284a0)" waittime="1541" ownerId="21923027" transactionname="user_transaction" lasttranstarted="2013-07-02T18:03:42.260" XDES="0x80051950" lockMode="RangeS-U" schedulerid="2" kpid="2712" status="suspended" spid="54" sbid="0" ecid="0" priority="0" trancount="1" lastbatchstarted="2013-07-02T18:03:42.260" lastbatchcompleted="2013-07-02T18:03:42.260" clientapp=".Net SqlClient Data Provider" hostname="XXX" hostpid="2148" loginname="XXX" isolationlevel="serializable (4)" xactid="21923027" currentdb="5" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056"&gt; ... &lt;/process&gt; &lt;process id="processc4d048" taskpriority="0" logused="0" waitresource="KEY: 5:72057594042646528 (a0c936a3c965)" waittime="1541" ownerId="21923023" transactionname="user_transaction" lasttranstarted="2013-07-02T18:03:42.260" XDES="0x80049800" lockMode="RangeS-U" schedulerid="4" kpid="2492" status="suspended" spid="53" sbid="0" ecid="0" priority="0" trancount="1" lastbatchstarted="2013-07-02T18:03:42.260" lastbatchcompleted="2013-07-02T18:03:42.260" clientapp=".Net SqlClient Data Provider" hostname="XXX" hostpid="2148" loginname="XXX" isolationlevel="serializable (4)" xactid="21923023" currentdb="5" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056"&gt; ... &lt;/process&gt; &lt;/process-list&gt; &lt;resource-list&gt; &lt;keylock hobtid="72057594042646528" dbid="5" objectname="dbo.SomeTable" indexname="PK_SomeTable" id="lock83d99200" mode="RangeS-U" associatedObjectId="72057594042646528"&gt; &lt;owner-list&gt; &lt;owner id="processc4d048" mode="RangeS-U"/&gt; &lt;/owner-list&gt; &lt;waiter-list&gt; &lt;waiter id="processc19dc8" mode="RangeS-U" requestType="wait"/&gt; &lt;/waiter-list&gt; &lt;/keylock&gt; &lt;keylock hobtid="72057594042646528" dbid="5" objectname="dbo.SomeTable" indexname="PK_SomeTable" id="lock89b52900" mode="U" associatedObjectId="72057594042646528"&gt; &lt;owner-list&gt; &lt;owner id="processc19dc8" mode="U"/&gt; &lt;/owner-list&gt; &lt;waiter-list&gt; &lt;waiter id="processc4d048" mode="RangeS-U" requestType="wait"/&gt; &lt;/waiter-list&gt; &lt;/keylock&gt; &lt;/resource-list&gt; &lt;/deadlock&gt; &lt;/deadlock-list&gt; </code></pre> <p>So it looks like the first process owns a resource with <code>mode=U</code>, and the second owns the same resource with <code>mode=RangeS-U</code>.</p> <p>How it is possible if these two modes are not compatible with each other (according to the <a href="http://msdn.microsoft.com/en-us/library/ms186396.aspx" rel="nofollow">compatibility matrix</a>)?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload