首页 新闻 会员 周边

sqlserver 两个独立的表为什么会产生死锁

0
[已关闭问题] 关闭于 2019-05-15 10:12

高并发下,sqlserver 两个独立的表为什么会产生死锁,上面截图中键锁的 Object Name 是 Table1。

Table1.Id 为主键

Table1.UserId 非聚集索引

有木有大佬指点指点,拜谢~

事务1:

(@p__linq__0 int)SELECT TOP (1)
[Extent1].[Id] AS [Id],
[Extent1].[UserId] AS [UserId],
[Extent1].[Email] AS [Email],
[Extent1].[CreateTime] AS [CreateTime],
[Extent1].[UpdateTime] AS [UpdateTime]
FROM Table1 AS [Extent1]
WHERE [Extent1].[UserId] = @p__linq__0

事务2:

(@0 bigint,@1 uniqueidentifier,@2 int,@3 int,@4 nvarchar(max) ,@5 int,@6 int,@6 decimal(38,8),@7 datetime2(7),@8 datetime2(7))INSERT Table2([Id], [TradeId], [OrderSide], [UserId], [Email], [RewardUserId], [Qty], [CreateTime], [UpdateTime])
VALUES (@0, @1, @2, @3, @4, @5, @6, @7, @8)

小小小蘑菇的主页 小小小蘑菇 | 初学一级 | 园豆:88
提问于:2018-06-15 18:32
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册