Oracle在同一事务中访问更新的记录 [英] Oracle Accessing updated records during the same transaction

查看:103
本文介绍了Oracle在同一事务中访问更新的记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Oracle 10g

Using Oracle 10g

是否有可能在提交之前在同一事务中获取新更新字段的值.

Is it possible to get the value of a newly updated field within the same transaction before it is committed.

我正在执行一个存储过程,该存储过程将调用另外2个存储过程.

I am executing a stored procedure which calls 2 other stored procedures.

第一个存储过程从表中获取一条记录,然后更新该记录.

The first stored procedure gets a record from a table and then updates that record.

第二个存储过程获得了相同的记录,但需要使用第一个存储过程中新近更新的字段.

The second stored procedure gets that same record but needs to use the newly updated fields from the first stored procedure.

然后执行提交.

仅在两个过程都成功执行的情况下才能执行提交.

The commit can only be done if both procedures are carried out sucessfully.

第二个存储过程将获取新近更新的数据,还是将获取第一个存储过程中未更新而返回的相同数据的副本?

Will the second stored procedure get the newly updated data or will it get a copy of the same data that was returned in the first procedure without the update ?

推荐答案

Oracle具有非常简单且健壮的读取一致性实现:

Oracle has a very simple and robust implementation of read consistency:

  • 用户可以看到数据的最新版本,包括当前交易所做的任何更改,但是...
  • 一个用户看不到任何其他用户所做的更改,除非该其他用户发出了提交,甚至直到执行新的语句后才看到.

这在《概念指南》中有介绍. 了解更多.

This is covered in the Concepts Guide. Find out more.

这篇关于Oracle在同一事务中访问更新的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆