问题
Using Oracle 10g
Is it possible to get the value of a newly updated field within the same transaction before it is committed.
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.
Then the commit is carried out.
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 ?
回答1:
Oracle has a very simple and robust implementation of read consistency:
- a user sees the latest version of the data, including any changes made by the current transaction, but ...
- a user cannot see the changes made by any other user until that other user issues a commit, and even then not until executing a new statement.
This is covered in the Concepts Guide. Find out more.
来源:https://stackoverflow.com/questions/13514303/oracle-accessing-updated-records-during-the-same-transaction