create table T(
key int not null primary key,
value int
);
insert into T values (1, 100);
Process 1 |
Process 2 |
begin; read * from T; | |
|
begin;
update T set value = 999 where key = 1;
insert into T values (3, 300);
commit;
|
read * from T; | |
|
|
Result of the second read
- Serializable:
- (1, 100) is unchanged.
- (3, 300) is not present.
- Repeatable Read:
- (1, 100) is unchanged.
- (3, 300) is present: Phantom row.
- Read Committed:
- (1, 100) → (1, 999): See committed change.
- (3, 300) is present: Phantom row.
|