首页 > IT职业 > IT生活 > 一种等待S锁的死锁现象
DEADLOCK DETECTED
Current SQL statement for this session:
insert into tableName(custidl_pk, custidl_fk, certtpstr, ifaloneidl, custtpidl_pk, custstr, custnamestr, addrcodestr, setupaddrstr, familyaddrstr, certcodestr, workstr, agestr, nationstr, mailstr, telstr, mobilestr, sexstr, zipcodestr, unitnamestr, hfccuststr, ifvalididl, pwd, mem, creatorstr, belongareastr,USERTPCODESTR, hfcmainidl,hfcextidl,sub_description,agentstr) values(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10, :11,:12,:13,:14,:15,:16,:17,:18,:19,:20,:21,:22,:23,:24,:25,:26,:27,:28,:29,:30,:31)
The following deadlock is not an ORACLE error. It is a
deadlock due to user error in the design of an application
or from issuing incorrect ad-hoc SQL. The following
information may aid in determining the deadlock:
Deadlock graph:
---------Blocker(s)-------- ---------Waiter(s)---------
Resource Name process session holds waits process session holds waits
TX-00040016-00031e8d 21 30 X 18 22 S
TX-00030027-00033daa 18 22 X 21 30 S
session 30: DID 0001-0015-00000002 session 22: DID 0001-0012-00000002
session 22: DID 0001-0012-00000002 session 30: DID 0001-0015-00000002
Rows waited on:
Session 22: no row
Session 30: no row
Information on the OTHER waiting sessions:
Session 22:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
program: JDBC Thin Client
Current SQL Statement:
insert into tableName(custidl_pk, custidl_fk, certtpstr, ifaloneidl, custtpidl_pk, custstr, custnamestr, addrcodestr, setupaddrstr, familyaddrstr, certcodestr, workstr, agestr, nationstr, mailstr, telstr, mobilestr, sexstr, zipcodestr, unitnamestr, hfccuststr, ifvalididl, pwd, mem, creatorstr, belongareastr,USERTPCODESTR, hfcmainidl,hfcextidl,sub_description,agentstr) values(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10, :11,:12,:13,:14,:15,:16,:17,:18,:19,:20,:21,:22,:23,:24,:25,:26,:27,:28,:29,:30,:31)
End of information on OTHER waiting sessions.
两个session当前语句都是一样的,而且等待互相等待S锁,这种死锁现象不太常见,查了一下表,原来有个unique列。
create table TEST
(
ID NUMBER(5) not null,
NAME VARCHAR2(10) unique
)
session 1:
INSERT INTO TEST
VALUES(1,'GYH');
INSERT INTO TEST
VALUES(2,'YGM');
session 2:
INSERT INTO TEST
VALUES(3,'YGM');
INSERT INTO TEST
VALUES(4,'GYH');
结果与该情况一致,因此初步判断由于唯一键相同导致的该死锁问题,很难想象他们的应用是怎么做到的.
[@more@]来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/112417/viewspace-921060/ ,如需转载,请注明出处,否则将追究法律责任。