马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?站点注册
×
本帖最后由 lxx999 于 2010-1-12 13:15 编辑
Deadlock Id 2564: Process 30 was involved in application 'ZXIN10_APandCP'.
Deadlock Id 2564: Process 30 was involved on host name 'ZX133_1'.
Deadlock Id 2564: Process 30 was involved in transaction '$user_transaction'.
SQL Text: exec test.dbo.sp1 '000', '84596081', 'k19sKe', 1, 1652522, 4, 1 , 1 , 1 , '#####################1' commit tran
Deadlock Id 2564: Process (Familyid 0, Spid 64, Suid 3) was executing a UPDATE command in the procedure sp1 at line 110 at nested level 1.
Deadlock Id 2564: Process 64 was involved in application 'ZXIN10_APandCP'.
Deadlock Id 2564: Process 64 was involved on host name 'ZX133_2'.
Deadlock Id 2564: Process 64 was involved in transaction '$user_transaction'.
SQL Text: exec test.dbo.sp_xxxxx1 0,'84596075', 1,1 commit tran
Deadlock Id 2564: Process (Familyid 0, Spid 64) was waiting for a 'update page' lock on page 129945 of the xxxxxxxxxxxx table in database 7 but process (Familyid 0, Spid 30) already held a 'exclusive page' lock on it.
Deadlock Id 2564: Process (Familyid 0, Spid 30) was waiting for a 'exclusive page' lock on page 513305 of the xxxxxxxxxxxx table in database 7 but process (Familyid 0, Spid 64) already held a 'update page' lock on it.
Deadlock Id 2564: Process (Familyid 0, Spid 30) was chosen as the victim. End of deadlock information.
00:00000:00030:2009/11/02 16:03:32.15 server Deadlock Id 2565 detected
Deadlock Id 2565: detected. 1 deadlock chain(s) involved.
RE:说明一下, 正常的实时开户流程会先调用 sp1 ,然后再调用 sp2 ,应该是有多个用户开户时造成的死锁。
原因是 sp1 执行了一个插入操作, 而在 sp2 中进行了更新。
我的疑惑在于为何死锁来自同一张表? 正常的死锁是由于多个表更新造成的。
在插入的表中建有非聚集索引。 锁表是使用AOL锁表。
我分析可能的原因,是在插入的时候先写下到了最后一个页面中, 然后会去修改索引页,
而另外一个进程,已经在使用了索引页, 准备去更新数据页。所以造成了死锁。 |