LOCK_TIMEOUT
--查当前数据库是事务隔离级别
DBCC USEROPTIONS
SET LOCK_TIMEOUT 1000
begin tran TranNameA
select * from tablenameA WITH (updlock) where...
waitfor delay '00:00:05'
https://blog.csdn.net/ruthywei/article/details/73558885
query1:
begin tran TranNameA
select * from [cap-test].[Cap].[Received] with (rowlock holdlock) where id='1054025814804271104'
waitfor delay '00:00:35'
commit tran TranNameA
query2:
update [cap-test].[Cap].[Received] set Retries=1 where id='1054025814804271104'
query3:
select * from [cap-test].[Cap].[Received] where id='1054025814804271104'
从query1顺序执行到query3
query3这个时候也需要等待
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步