免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2478 | 回复: 5
打印 上一主题 下一主题

next key与'shared row' 'range'的 死锁问题, [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-08-10 14:04 |只看该作者 |倒序浏览
00:00000:00035:2006/08/10 09:13:38.29 server  Deadlock Id 47 detected
Deadlock Id 47: detected. 1 deadlock chain(s) involved.

Deadlock Id 47: Process (Familyid 115, 115) (suid 7) was executing a INSERT command at line 1.
SQL Text: ^A ^D1100^D1100^A ^A1^A ^A ^D划款^A ^A ^A ^A ^A0
Deadlock Id 47: Process (Familyid 35, 35) (suid 7) was executing a INSERT command at line 1.
SQL Text:  ^A0^A ^H70000.00^A ^A ^A ^D1100^D2900^A ^A0^A0^A ^D货款^A1^A ^A0^A ^A
7
Deadlock Id 47: Process (Familyid 0, Spid 35) was waiting for a 'next key' lockon row 0 page 6069161 of the 'dedja' table in database 6 but process (Familyid 115, Spid 115) already held a 'shared row' 'range' lock on it.
Deadlock Id 47: Process (Familyid 0, Spid 115) was waiting for a 'exclusive intent' lock on the 'dedja' table in database 6 but process (Familyid 35, Spid 35) already held a 'exclusive intent' lock on it.

Deadlock Id 47: Process (Familyid 0, 115) was chosen as the victim. End of deadlock information.

next key锁、'shared row' 'range' 锁是怎么产生的呢?
两个插入操作怎么会造成死锁呢?

论坛徽章:
1
2017金鸡报晓
日期:2017-01-10 15:19:56
2 [报告]
发表于 2006-08-10 14:52 |只看该作者
是不是有在事务隔离级为3的情况下,一个语句先update,如果没有记录就insert ?

论坛徽章:
4
2015年亚洲杯之阿联酋
日期:2015-03-10 10:32:022015年亚洲杯之阿曼
日期:2015-03-10 14:53:222015亚冠之水原三星
日期:2015-07-18 15:40:262015亚冠之塔什干棉农
日期:2015-07-27 20:52:05
3 [报告]
发表于 2006-08-10 14:58 |只看该作者
what's your isolation level?

论坛徽章:
0
4 [报告]
发表于 2006-08-10 22:18 |只看该作者
原因可能查到了
再isql里面select @@isolation是1
但是应用程序是cp程序,cpre编译中自动会加上隔离级别为3的

但是从上面日志上看,死锁是两个insert插入造成的,为什么会有这种情况呢??

论坛徽章:
0
5 [报告]
发表于 2006-08-11 11:14 |只看该作者
高版本的SYBASE是有这种问题,我上次在12.0上没问题的程序,在12.5.3就不行。和SYBASE公司的咨询了很长时间,没有别的办法,只有降低隔离级别。
CPRE有个参数的。

论坛徽章:
0
6 [报告]
发表于 2006-08-11 17:14 |只看该作者
我查了,,-r参数可以,,
-r
disables repeatable reads. If you do not use this option, a set transaction
isolation level 3 statement is generated and will be executed during connect
statements.
但是加上以后,从程序中输出来的exec sql select @@isolation,
怎么还是3呢??

难道非得在程序用exec sql set transaction isolation 1
吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP