**** Error 星期四 十月 25 01:23:36 CST 2012 1351099416103 /atg/dynamo/messaging/SqlJmsProvider ---
java.sql.SQLSyntaxErrorException: ORA-02049: 超时: 分布式事务处理等待锁
**** Error 星期四 十月 25 01:23:36 CST 2012 1351099416103 /atg/dynamo/messaging/SqlJmsProvider
**** Error 星期四 十月 25 01:23:36 CST 2012 1351099416103 /atg/dynamo/messaging/SqlJmsProvider
**** Error 星期四 十月 25 01:23:36 CST 2012 1351099416103 /atg/dynamo/messaging/SqlJmsProvider
.....
应用发版部分服务器重启,应用服务器启动报错“超时: 分布式事务处理等待锁”,根据ORACLE官方的说法这是避免死锁的一种机制
遇到这种问题时等一会(至少等distributed_lock_timeout那么久吧,所以这个值设置过大会导致一些不可知的风险),再次尝试会自动恢复。
Error: ORA 2049
Text: timeout: distributed transaction waiting for lock
-------------------------------------------------------------------------------
Cause: Exceeded <Parameter:DISTRIBUTED_LOCK_TIMEOUT> seconds waiting for lock.
Action: treat as a deadlock
*** Important: The notes below are for experienced users - See Note:22080.1
Explanation:
Ignore the "Action" above - this is non-sense.
Basically ORA 2049 is signalled if:
a) you are waiting on another sessions TX enqueue
(Eg: usually you are waiting for a row lock)
AND b) you are performing a distributed operation.
Eg: You are using a DB link for something, even if it is only a
select
AND c) You wait for longer than 'distributed_lock_timeout'
The use of a DB Link opens you up to distributed rules of operation
even if you only READ from it.
You can either increase the timeout OR handle the ORA 2049 as a 'try again'
exception that is not fatal. This mechanism exists to prevent deadlock
so any handling of 'TRY AGAIN' should include an escape clause to prevent
deadlock.
Example:
Session 1 Session 2
~~~~~~~~~ ~~~~~~~~~
update t2@LINK set b=4 where b=3;
select * from dual@LINK;
update t2 set b=4 where b=3;
^^ ORA 2049
OR EVEN
update t2 set b=4 where b=3;
select * from dual@LINK;
update t2 set b=4 where b=3;
^^ ORA 2049