僵局 [英] Deadlock

查看:71
本文介绍了僵局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨。

我有几个相同的java应用程序实例同时工作在
DB2 v8.2上。所有这些:

- 将事务隔离级别设置为TRANSACTION_READ_UNCOMMITTED,

- 尝试插入到同一个表T1中,

- 解析触发器:

- 在插入T1之前,

- 插入T1之后

从表T2中选择。


除了一个之外,发生了一个例外:SQLCODE:911,SQLSTATE:

40001,SQLERRMC:2。当我放弃触发器中的select语句时,

应用程序似乎工作正常。


有人可以解释为什么在事务隔离时发生死锁

级别设置为TRANSACTION_READ_UNCOMMITTED以及如何解决问题。


问候,


Rafa3

Hi.
I have a few instances of same java application working concurrent on
DB2 v8.2. All of them:
- has a transaction isolation level set to TRANSACTION_READ_UNCOMMITTED,
- try to insert into same table T1,
- resolves triggers:
- BEFORE INSERT ON T1,
- AFTER INSERT ON T1
which selects from table T2.

In all, except one, occurred an exception with: SQLCODE: 911, SQLSTATE:
40001, SQLERRMC: 2. When I give up with select statement in triggers,
applications seems to work fine.

Can someone explain why the deadlock occurs with transaction isolation
level set to TRANSACTION_READ_UNCOMMITTED and how to solve the problem.

Regards,

Rafa3

推荐答案

" RZ" < ZY ** @ wp.pl>在消息新闻中写道:ds ********** @ news.onet.pl ...
"RZ" <zy**@wp.pl> wrote in message news:ds**********@news.onet.pl...
嗨。
我有几个相同的java应用程序同时工作的实例在DB2
v8.2上。所有这些:
- 将事务隔离级别设置为TRANSACTION_READ_UNCOMMITTED, -
尝试插入到同一个表T1中,
- 解析触发器:
- 在插入T1之前,
- 插入T1后,从表T2中选择。

总之,除了一个,发生了一个例外:SQLCODE:911,SQLSTATE:
40001,SQLERRMC :2。当我放弃触发器中的select语句时,
应用程序似乎工作正常。

有人可以解释为什么在事务隔离
级别设置为TRANSACTION_READ_UNCOMMITTED时发生死锁如何解决问题。

问候,

Rafa3
Hi.
I have a few instances of same java application working concurrent on DB2
v8.2. All of them:
- has a transaction isolation level set to TRANSACTION_READ_UNCOMMITTED, -
try to insert into same table T1,
- resolves triggers:
- BEFORE INSERT ON T1,
- AFTER INSERT ON T1
which selects from table T2.

In all, except one, occurred an exception with: SQLCODE: 911, SQLSTATE:
40001, SQLERRMC: 2. When I give up with select statement in triggers,
applications seems to work fine.

Can someone explain why the deadlock occurs with transaction isolation
level set to TRANSACTION_READ_UNCOMMITTED and how to solve the problem.

Regards,

Rafa3




DB2中的事务隔离级别仅影响共享(选择)锁。它

不会影响因插入,更新,删除,

或选择更新而导致的锁定。


尝试设置此实例参数(可能需要实例停止和

start)。我认为你需要FP9或更高版本,但不确定。


db2set DB2_SKIPINSERTED = ON



The transaction isolation level in DB2 only affects share (select) locks. It
does not affect locks that are taken as a result of insert, update, delete,
or select for update.

Try setting this instance parameter (probably requires instance stop and
start). I think you need FP9 or higher, but not sure.

db2set DB2_SKIPINSERTED=ON


Mark A写道:
尝试设置此实例参数(可能需要实例停止和
启动)。我认为你需要FP9或更高版本,但不确定。

db2set DB2_SKIPINSERTED = ON
Try setting this instance parameter (probably requires instance stop and
start). I think you need FP9 or higher, but not sure.

db2set DB2_SKIPINSERTED=ON




我有fixpak 3 instaled,DB2_SKIPINSERTED设置为ON - 它没有帮助。



I''ve got fixpak 3 instaled, DB2_SKIPINSERTED set to ON - it doesn''t help.


RZ写道:
Mark A写道:
Mark A wrote:
尝试设置此实例参数(可能需要实例停止
并启动)。我认为你需要FP9或更高版本,但不确定。

db2set DB2_SKIPINSERTED = ON
Try setting this instance parameter (probably requires instance stop
and start). I think you need FP9 or higher, but not sure.

db2set DB2_SKIPINSERTED=ON



我已经修复了fixpak 3,DB2_SKIPINSERTED设置为ON - 它没有帮助。


I''ve got fixpak 3 instaled, DB2_SKIPINSERTED set to ON - it doesn''t help.



发布你的触发器。您可能需要理顺

执行的顺序。顺便说一句,有些操作需要DB2升级

隔离级别。例如。对于RI。有没有这些?


干杯

Serge

-

Serge Rielau
DB2解决方案开发

IBM多伦多实验室


Post your triggers. You probably need to straighten out the ordering of
execution. BTW, there are some operations where DB2 has to upgrade the
isolation level. E.g. for RI. Got any of those?

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab


这篇关于僵局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆