微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

sql – Oracle是否在错误时回滚事务?

这感觉就像一个愚蠢的问题,但我在Oracle事务管理概念指南中看到以下内容

A transaction ends when any of the
following occurs:

A user issues a COMMIT or ROLLBACK
statement without a SAVEPOINT clause.

A user runs a DDL statement such as
CREATE,DROP,RENAME,or ALTER. If the
current transaction contains any DML
statements,Oracle first commits the
transaction,and then runs and commits
the DDL statement as a new,single
statement transaction.

A user disconnects from Oracle. The
current transaction is committed.

A user process terminates abnormally.
The current transaction is rolled
back.

我是否要解释最后一点意味着如果我发出一个错误查询,那么事务将被回滚?

解决方法

此上下文中的“用户进程”是指在客户端计算机上运行的进程,该进程创建与Oracle的连接.换句话说,如果您使用应用程序A(sql * Plus,TOAD等)连接到Oracle,则用户进程是sql * Plus,TOAD等.如果该用户进程在您处于中间状态时死亡事务,该事务将被回滚.一旦PMON发现客户端已经死亡可能需要一些时间,就会发生这种情况 – 对于Oracle来说,区分用户进程的失败和刚刚未发出命令的用户进程并不总是微不足道的.此时此刻.

原文地址:https://www.jb51.cc/mssql/75219.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐