Re: read consistency




Michel Cadot wrote:
"Prasath" <prasath.rao@xxxxxxxxx> a écrit dans le message de news: 1151596534.551557.236640@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
| Session 1:
| --------------------
| select * from my_table; ->takes 5 minutes
|
| Session 2:
| -------------------
| delete from my_table where my_col = 1; -> takes less than 1 second
|
| commit;
|
|
| Question
| ---------------------
| Do the records deleted in session 2 appear in session 1?
|

Yes, if session 1 query starts before session 2 commit.

Regards
Michel Cadot

Definitely as Michel said. By default all SQL statements are read
consistent at the point in time of when the statement starts execution.
The Oracle read consistency model is discussed in the Concepts Manual
for your version. For 9.2 the chapter is 20 Data Concurrency and
Consistency.

From Ch 1.>>
Read consistency, as supported by Oracle, does the following:

Guarantees that the set of data seen by a statement is consistent with
respect to a single point in time and does not change during statement
execution (statement-level read consistency)
Ensures that readers of database data do not wait for writers or other
readers of the same data
Ensures that writers of database data do not wait for readers of the
same data
Ensures that writers only wait for other writers if they attempt to
update identical rows in concurrent transactions
<<

HTH -- Mark D Powell --

.



Relevant Pages

  • Re: read consistency
    ... if session 1 query starts before session 2 commit. ... Michel Cadot ...
    (comp.databases.oracle.misc)
  • Re: BEGIN TRANS... Wheres The Error?
    ... I want to block another session from reading ... >row until the commit but they can both read at the same ... use of UPDLOCK inside ... both instances would be executing at the ...
    (microsoft.public.sqlserver.programming)
  • Re: if I call a plsql is there a commit?
    ... After p2 is there a commit or it is after end? ... Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production ... SQL> CREATE PROCEDURE p2 IS ... -- Session 2 in a different SQL*Plus session ...
    (comp.databases.oracle.misc)
  • Re: index duplicate values, how much ?
    ... set lock mode to not wait; ... Then, in Session 2: ... And now we commit in both session (the order of the sessions is ...
    (comp.databases.informix)
  • Re: HowTo - create user defined sequence with proper serialization
    ... in a second session, issue a select for update against the table ... commit in the first session ... CURSOR masksCursor IS ... ORDER BY mask ...
    (comp.databases.oracle.server)