首页 > 应用开发 > IT综合 > Deadlock Detection (338)

Deadlock Detection (338)

原创 IT综合 作者:tsinglee 时间:2007-12-10 11:44:31 0 删除 编辑

Oracle automatically detects deadlock situations and resolves them by rolling back one
of the statements involved in the deadlock, thereby releasing one set of the conflicting
row locks. A corresponding message also is returned to the transaction that undergoes
statement-level rollback. The statement rolled back is the one belonging to the
transaction that detects the deadlock. Usually, the signalled transaction should be
rolled back explicitly, but it can retry the rolled-back statement after waiting.

Note: In distributed transactions, local deadlocks are detected
by analyzing wait data, and global deadlocks are detected by a time
out. Once detected, nondistributed and distributed deadlocks are
handled by the database and application in the same way.

Deadlocks most often occur when transactions explicitly override the default locking
of Oracle. Because Oracle itself does no lock escalation and does not use read locks for
queries, but does use row-level locking (rather than page-level locking), deadlocks
occur infrequently in Oracle.

1. 当遇到死锁时,Oracle将自动回滚检查到死锁的语句
2. 当事务显示的覆盖了默认的锁方式时,更容易发生死锁 . 因为Oracle不会进行锁升级,
不会在查询时使用读锁 , 而使用行级别锁,这样发生死锁的现象就少见
注意 :
对于分布式事务,Oracle 通过分析被等待的数据来检测本地死锁,而全局死锁则是根据超时来检测的


来自 “ ITPUB博客 ” ,链接:,如需转载,请注明出处,否则将追究法律责任。

上一篇: Deadlocks (337)
下一篇: Avoid Deadlocks (339)
请登录后发表评论 登录
  • 博文量
  • 访问量