简体   繁体   English

我的 DML 查询不会影响 Oracle 数据库中的行吗?

[英]My DML queries are not affecting row in Oracle DB?

I have an application that works as expected and I can insert/update the rows through application.我有一个按预期工作的应用程序,我可以通过应用程序插入/更新行。 But when I connect to my oracle database through SQL Developer and tried to run the UPDATE query, I get message that 1 row is updated.但是当我通过 SQL Developer 连接到我的 oracle 数据库并尝试运行 UPDATE 查询时,我收到一条消息,即更新了 1 行。 while the row is not updated.而该行未更新。

Also the user I used to connect oracle database is same for both Application and SQL Developer with having insert and update privileges.此外,我用来连接 oracle 数据库的用户对于 Application 和 SQL Developer 具有插入和更新权限是相同的。

I feel a transparency Layer is implemented in oracle database that blocks the direct query execution.我觉得在 oracle 数据库中实现了一个透明层,它阻止了直接查询的执行。 Can anyone knows how this feature is implemented or which oracle product is configured?谁能知道这个功能是如何实现的或者配置了哪个 oracle 产品?

After DML, you will have to commit the transaction to make actual changes in the database.在 DML 之后,您必须commit事务才能在数据库中进行实际更改。

Without commit , you will see the changed data in current session but other sessions will not be able to see that changes.如果没有commit ,您将在当前 session 中看到更改的数据,但其他会话将无法看到该更改。 Or you can say, it is not actually changed in database too without commit .或者您可以说,如果没有commit ,它实际上也没有在数据库中更改。

My experience with Oracle is that most SQL applications that connect to oracle do not auto-commit (make permanent changes to the database record when you run a DML) when auto-commit option is off.我对 Oracle 的经验是,大多数连接到 oracle 的 SQL 应用程序在运行 DML 时不会自动提交(对数据库记录进行永久更改)。 Any DML run should be followed by the commit;任何 DML 运行都应该跟在提交之后; command.命令。 You can turn on auto-commit in SQL Developer by going to the Menu item Tools > Preferences > Advanced > then "check" the auto commit option if you do not want to run the command every time.您可以在 SQL Developer 中打开自动提交功能,方法是转到菜单项工具 > 首选项 > 高级 > 如果您不想每次都运行该命令,则“检查”自动提交选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM