SQLSERVER 语句交错引发的死锁问题案例详解(发生sql错误)怎么可以错过

随心笔谈2年前发布 编辑
149 0
🌐 经济型:买域名、轻量云服务器、用途:游戏 网站等 《腾讯云》特点:特价机便宜 适合初学者用 点我优惠购买
🚀 拓展型:买域名、轻量云服务器、用途:游戏 网站等 《阿里云》特点:中档服务器便宜 域名备案事多 点我优惠购买
🛡️ 稳定型:买域名、轻量云服务器、用途:游戏 网站等 《西部数码》 特点:比上两家略贵但是稳定性超好事也少 点我优惠购买

<deadlock-list>
<deadlock victim=”process2d69c9748c8″>
<process-list>
<process id=”process2d69c9748c8″ taskpriority=”0″ logused=”324″ waitresource=”KEY: 7:72057594043170816 (8194443284a0)” waittime=”1304″ ownerId=”70740″ transactionname=”user_transaction” lasttranstarted=”2023-02-19T22:11:26.413″ XDES=”0x2d6a0200428″ lockMode=”S” schedulerid=”5″ kpid=”13816″ status=”suspended” spid=”66″ sbid=”0″ ecid=”0″ priority=”0″ trancount=”1″ lastbatchstarted=”2023-02-19T22:11:26.413″ lastbatchcompleted=”2023-02-19T22:11:26.410″ lastattention=”1900-01-01T00:00:00.410″ clientapp=”Microsoft SQL Server Management Studio – Query” hostname=”DESKTOP-STS8TPB” hostpid=”1696″ loginname=”DESKTOP-STS8TPB\Administrator” isolationlevel=”read committed (2)” xactid=”70740″ currentdb=”7″ currentdbname=”Northwind” lockTimeout=”4294967295″ clientoption1=”671090784″ clientoption2=”390200″>
<executionStack>
<frame procname=”adhoc” line=”5″ stmtstart=”24″ stmtend=”128″ sqlhandle=”0x020000007383d935b349bc173c0f104de14945e9a526322b0000000000000000000000000000000000000000″>
unknown </frame>
<frame procname=”adhoc” line=”5″ stmtstart=”204″ stmtend=”294″ sqlhandle=”0x020000002c3b203105961d63d10b17e54ed6ac081105f9450000000000000000000000000000000000000000″>
unknown </frame>
</executionStack>
<inputbuf>

BEGIN TRAN
UPDATE dbo.Orders SET ShipAddress=’上海’ WHERE OrderID=10258
WAITFOR DELAY ’00:00:10′
SELECT * FROM dbo.Employees WHERE EmployeeID=1;
ROLLBACK
</inputbuf>
</process>
<process id=”process2d6ae694ca8″ taskpriority=”0″ logused=”368″ waitresource=”KEY: 7:72057594044088320 (59ce0997f9b8)” waittime=”3468″ ownerId=”70716″ transactionname=”user_transaction” lasttranstarted=”2023-02-19T22:11:24.247″ XDES=”0x2d6a7284428″ lockMode=”S” schedulerid=”9″ kpid=”7124″ status=”suspended” spid=”65″ sbid=”0″ ecid=”0″ priority=”0″ trancount=”1″ lastbatchstarted=”2023-02-19T22:11:24.247″ lastbatchcompleted=”2023-02-19T22:11:24.247″ lastattention=”1900-01-01T00:00:00.247″ clientapp=”Microsoft SQL Server Management Studio – Query” hostname=”DESKTOP-STS8TPB” hostpid=”1696″ loginname=”DESKTOP-STS8TPB\Administrator” isolationlevel=”read committed (2)” xactid=”70716″ currentdb=”7″ currentdbname=”Northwind” lockTimeout=”4294967295″ clientoption1=”671090784″ clientoption2=”390200″>
<executionStack>
<frame procname=”adhoc” line=”5″ stmtstart=”26″ stmtend=”118″ sqlhandle=”0x02000000dd7720067e0519b8a368501716c04b4b50cfe6be0000000000000000000000000000000000000000″>
unknown </frame>
<frame procname=”adhoc” line=”5″ stmtstart=”196″ stmtend=”282″ sqlhandle=”0x0200000093f01512208755a056f5f28930fbd3dedf58a2850000000000000000000000000000000000000000″>
unknown </frame>
</executionStack>
<inputbuf>

BEGIN TRAN
UPDATE dbo.Employees SET Title=’Dr.’ WHERE EmployeeID=1;
WAITFOR DELAY ’00:00:10′
SELECT * FROM dbo.Orders WHERE OrderID=10258
ROLLBACK
</inputbuf>
</process>
</process-list>
<resource-list>
<keylock hobtid=”72057594043170816″ dbid=”7″ objectname=”Northwind.dbo.Employees” indexname=”PK_Employees” id=”lock2d69ccbbb80″ mode=”X” associatedObjectId=”72057594043170816″>
<owner-list>
<owner id=”process2d6ae694ca8″ mode=”X”/>
</owner-list>
<waiter-list>
<waiter id=”process2d69c9748c8″ mode=”S” requestType=”wait”/>
</waiter-list>
</keylock>
<keylock hobtid=”72057594044088320″ dbid=”7″ objectname=”Northwind.dbo.Orders” indexname=”PK_Orders” id=”lock2d69ccbbf80″ mode=”X” associatedObjectId=”72057594044088320″>
<owner-list>
<owner id=”process2d69c9748c8″ mode=”X”/>
</owner-list>
<waiter-list>
<waiter id=”process2d6ae694ca8″ mode=”S” requestType=”wait”/>
</waiter-list>
</keylock>
</resource-list>
</deadlock>
</deadlock-list>

© 版权声明

相关文章