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博客 ” ,链接:http://blog.itpub.net/10599713/viewspace-990926/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/10599713/viewspace-990926/