java.sql.SQLSyntaxErrorException: ORA-02049: 超时: 分布式事务处理等待锁处理

 **** 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          

.....


应用发版部分服务器重启,应用服务器启动报错“超时: 分布式事务处理等待锁”,根据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


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值