kknight2046
Programmer
I found one statement from that is very confusing:
"A query in a transaction can see the changes made by previous DML statements in the same transaction, but cannot see the changes of other transactions begun after its own transaction."
Is it correct? I found a case that shows the statement is wrong.
I made a test by first creating a test table:
create table test (id number);
Then, I started two transactions:
Transaction 1 Transaction 2
Time1: insert into test values (1);
Time2: insert into test values (2);
Time3: commit;
Time4: select * from test;
After executing the select query at Time4, I saw the results below:
ID
1
2
That means, Transaction 1 CAN see the changes of Transaction 2, though Transaction 2 begun after transaction 1.
Any thoughts?
"A query in a transaction can see the changes made by previous DML statements in the same transaction, but cannot see the changes of other transactions begun after its own transaction."
Is it correct? I found a case that shows the statement is wrong.
I made a test by first creating a test table:
create table test (id number);
Then, I started two transactions:
Transaction 1 Transaction 2
Time1: insert into test values (1);
Time2: insert into test values (2);
Time3: commit;
Time4: select * from test;
After executing the select query at Time4, I saw the results below:
ID
1
2
That means, Transaction 1 CAN see the changes of Transaction 2, though Transaction 2 begun after transaction 1.
Any thoughts?