Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 12963

Request for comment on this Deadlock.....

$
0
0

I have a question regarding this deadlock (names changed to protect the innocent) that I hope you can comment on. The facts as I see them:

Victim = process ending in  6d8

Victor = process ending in  ac8

Two processes, from different hosts, are trying to update the same 18-column table (“MyTable”). From the “owner-list” section it appears the victor has an Exclusive lock on the table’s PK yet is waiting for an Update lock too. It also appears that the victim owns an Exclusive lock on the same key and is also requesting an update lock.

Can two process both have an exclusive lock on the same item?

TIA,

edm2

P.S To make things crazier the PK is the only index defined on that table! Need to look into that.

deadlock-list
 deadlock victim=process72356d8
  process-list
   process id=processeb9ac8 taskpriority=0 logused=528 waitresource=KEY: 5:72057616125788160
  
     frame procname=MyDB.dbo.MyProc1 line=238 stmtstart=17208

UPDATE MyTable 
      SET MyField1 = 0
      WHERE MyField2 = @MyField2 
       AND MyField3 = @MyField3
       AND MyField4 = @MyField4
       AND MyField1 = 1
       AND MyField5 = @MyField5
       AND MyField6 < @MyField6    
    inputbuf
Proc [Database Id = 5 Object Id = 907006858]   
   process id=process72356d8 taskpriority=0 logused=236 waitresource=KEY: 5:72057616125788160
     executionStack
     frame procname=MyDB.dbo.MyProc2 line=95 stmtstart=6034
     ..
UPDATE MyTable 
   SET MyField7 = @MyField7 ,
    MyField8 = @MyField8
   WHERE 
    MyField2   = @MyField2 
    AND MyField8  = @MyField8
    AND MyField10   = @MyField10 
    AND MyField3 = @MyField3 
    AND MyField4 = @MyField4 
    AND MyField11  = @MyField11 
    AND MyField1   = 1    
    AND MyField5   = @MyField5
 ...
   
   resource-list
   keylock hobtid=72057616125788160 dbid=5 objectname=MyDB.dbo.MyTable indexname=PK_myIndex id=lock8014a180 mode=X associatedObjectId=72057616125788160
    owner-list
     owner id=processeb9ac8 mode=X
    waiter-list
     waiter id=process72356d8 mode=U requestType=wait
   keylock hobtid=72057616125788160 dbid=5 objectname=MyDB.dbo.MyTable indexname=PK_myIndex id=lock268753280 mode=X associatedObjectId=72057616125788160
    owner-list
     owner id=process72356d8 mode=X
    waiter-list
     waiter id=processeb9ac8 mode=U requestType=wait


Viewing all articles
Browse latest Browse all 12963

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>