oracle死锁不能回滚吗?

Can oracle Deadlocks not be rolled back?

Oracle 中的死锁是否可能无法回滚,我们必须手动清除死锁?

我在 Oracle 文档中看到,它说:

Oracle Database automatically detects deadlocks and resolves them by rolling back one statement involved in the deadlock, releasing one set of the conflicting row locks.

我的问题是,是否存在这种情况不会发生的情况?

Is it possible that a Deadlock is not being rolled back in which we have to manually clear the Deadlock.

嗯,并不是所有事务都回滚了。 Oracle 自动检测死锁,抛出 ORA-00060: deadlock detected while waiting for resource,并回滚 Oracle 判定为受害者的死锁中涉及的事务之一。不会回滚先前成功的事务。即使在死锁错误之后,如果发出提交,先前成功的事务也会被提交。这时,另一个会话的事务也会成功,你就可以提交了。

死锁会自动清除 -- 您永远不需要清除它们。

详细的例子,看这个answer. You can reproduce with a simple test case as demonstrated here : Understanding Oracle Deadlock