Questions tagged [phantom-read]

5 questions
30
votes
8 answers

How to produce "phantom read" in REPEATABLE READ? (MySQL)

Using "repeatable read", it should be possible to produce a phantom read, but how? I need it for an example teaching CS-students. I think that I must make a "SELECT ... WHERE x<=888" on a non-indexed field x, with an upperlimit 888 not present, and…
Erik
  • 4,120
  • 2
  • 27
  • 20
10
votes
3 answers

PostgreSQL's Repeatable Read Allows Phantom Reads But its document says that it does not allow

I have a problem with Postgresql repeatable read isolation level. I did make an experiment about repeatable read isolation level's behavior when phantom read occurred. Postgresql's manual says "The table also shows that PostgreSQL's Repeatable Read…
1
vote
1 answer

Next-key lock explication - Primary key for range

I have the following query, and I wanted to use the diagram to CONFIRM IF I UNDERSTAND IT RIGHT: SELECT * FROM table WHERE pk > 99; "pk" is the primary key I am having trouble understanding the next key lock, I found this diagram to know which gap…
user19481364
1
vote
2 answers

"Non-repeatable read" and "phantom read" occur with 'SERIALIZABLE' isolation level (MySQL)

I experimented if non-repeatable read and phantom read occur or not with SERIALIZABLE on MySQL but against my expectation, both non-repeatable read and phantom read actually occurred with SERIALIZABLE. These below are the definitions of…
Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129
0
votes
2 answers

How to enforce a phantom read in PostgreSQL?

I'm currently writing an article about different transaction isolation levels and want to show the dirty read / non-repeatable read / phantom read. Dirty reads are impossible to show as PostgreSQL does not have READ_UNCOMMITTED, I do have an example…
Martin Thoma
  • 124,992
  • 159
  • 614
  • 958