Oracle DB Transactions — Phantom Read

Transaction T1 reads a set of data items satisfying some <search condition>. Transaction T2 then creates data items that satisfy T1 ’s <search condition> and commits. If T1 then repeats its read with the same <search condition>, it gets a set of data items different from the first read.

r1[P]…w2[y in P]…c2…r1[P]…c1

Image for post
Image for post
Phantom read occurs in “READ COMMITTED” isolation level in Oracle
Image for post
Image for post
Phantom read does not occur in “SERIALIZABLE” isolation level in Oracle

💡Serializable isolation level in Oracle is actually a “Snapshot Isolation”

Transaction 1

Transaction 2

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store