Dynamic SQL Statements:
Address AnchID StmtUID NumEnv NumVar NumRef NumExe Text
0x070000002F019680 53 5393 1 1 13 13 DELETE FROM LJSGetDraw WHERE
GetNoticeNo = ? AND PolNo = ? AND DutyCode = ? AND GetDutyKind = ? AND GetDutyCode = ? AND Currency = ?
0x070000003A28CBE0 188 7426 1 1 1 1 SELECT * FROM LJSGetDraw a
WHERE not exists(select 'X' from LJAGetDraw where PolNo=a.PolNo and DutyCode=a.DutyCode and GetDutyCode=a.GetDutyCode and
GetDutyKind=a.GetDutyKind and GetNoticeNo=a.GetNoticeNo) and GetDate<=date('2010-01-29') and nvl(ComeFlag,'x')<>'1' and
RReportFlag='0' and (not exists(select 1 from lccontstate where PolNo=a.PolNo and statetype='Available' and state='1' and
enddate is null) and not exists(select 'X' from lcconthangupstate where contno =a.contno and hanguptype='2' ) and
exists(select 'X' from LCPol where PolNo=a.PolNo and AppFlag='1' ) or exists (select 'x' from LMDutyGetAlive where
MAXGETCOUNTTYPE='0' and GETDUTYCODE=a.GETDUTYCODE))
//WebSphere的jndi连接池自动设置高级别的db2隔离级别
不同一个数据库连接的事物会有隔离级别的控制,在本地连接db2级别低,但是WebSphere的jndi连接池自动设置高级别的db2隔离级别,
所以在长时间使用sql语句的时候,需要手工设置隔离级别为最低ur,来避免锁。
具体修改是在RSWrapper.java类增加
strSQL += " with ur";
所有sql都手工设置隔离级别ur
死锁监控器:
9.创建一个针对死锁的event monitor
db2 "create event monitor dlmon for deadlocks with details write to file '/home/db2inst1/evmon'";
db2 set event monitor dlmon state 1;激活
db2evmon -db datcmg -evm dlmon >/home/db2inst1/文件名