2

In Oracle I ran a query in PL/SQL Developer like this :

declare a number;
  begin 
    EXECUTE IMMEDIATE 'ALTER SESSION SET ISOLATION_LEVEL= SERIALIZABLE';
    select count(*) into a  from item w where w.Item_num='MOH601' ; 
    dbms_output.put_line(a);
  end ; 

I don't commit or rollback this session , in another session I ran this :

begin
  EXECUTE IMMEDIATE 'ALTER SESSION SET ISOLATION_LEVEL =SERIALIZABLE';
  insert into item w
    (id, item_num, )
  values
    (200, 'MOH601');
end;

As I known serializable doesn't let phantom read , but I can commit this .

Mirza Sisic
  • 2,401
  • 4
  • 24
  • 38
Mohammad Mirzaeyan
  • 845
  • 3
  • 11
  • 30
  • 1
    I asked [this SO question](http://stackoverflow.com/questions/39567266/phantom-read-anomaly-in-oracle-and-postgresql-does-not-rollback-transaction) because i managed to see an inconsistency in Oracle and PostgreSQL. – Vlad Mihalcea Sep 19 '16 at 07:11

0 Answers0