我尝试从阻止查询中找到哪个锁,以阻止被阻止查询获取请求的锁。
如果我有如下所示的阻止进程报告。我可以看到阻塞的进程正在请求IX锁定,并且可以看到在哪个对象上请求了锁定。
但是是否有可能从阻止进程中看到哪种锁定以及在哪种资源上阻止阻止被锁定的进程获得该锁定?
<blocked-process-report monitorLoop="17746">
<blocked-process>
<process id="process265f3cb9088" taskpriority="0" logused="486476" waitresource="OBJECT: 6:135671531:27 " waittime="57714" ownerId="332360134" transactionname="implicit_transaction" lasttranstarted="2019-01-29T19:17:01.017" XDES="0x25c0d5977b8" lockMode="IX" schedulerid="29" kpid="11372" status="suspended" spid="51" sbid="0" ecid="0" priority="0" trancount="2" lastbatchstarted="2019-01-29T19:17:03.963" lastbatchcompleted="2019-01-29T19:17:03.963" lastattention="1900-01-01T00:00:00.963" hostpid="10056" loginname="macoprod" isolationlevel="read committed (2)" xactid="332360134" currentdb="6" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128058">
<executionStack>
<frame line="1" stmtstart="3242" stmtend="7914" sqlhandle="sqlhandle here" />
<frame line="1" sqlhandle="sqlhandle here" />
</executionStack>
<inputbuf> My insert statement goes here. </inputbuf>
</process>
</blocked-process>
<blocking-process>
<process status="running" spid="62" sbid="0" ecid="0" priority="0" trancount="1" lastbatchstarted="2019-01-29T19:17:52.080" lastbatchcompleted="2019-01-29T19:17:52.077" lastattention="1900-01-01T00:00:00.077" hostpid="12776" loginname="myuser" isolationlevel="read committed (2)" xactid="332355832" currentdb="6" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128058">
<executionStack>
<frame line="1" stmtstart="1878" stmtend="5158" sqlhandle="sqlhandle here" />
<frame line="1" sqlhandle="sqlhandle here" />
</executionStack>
<inputbuf> Select statement with updlock </inputbuf>
</process>
</blocking-process>
</blocked-process-report>