Unix Technical Forum

Phantom Read

This is a discussion on Phantom Read within the Oracle Miscellaneous forums, part of the Oracle Database category; --> I am a bit confused by exactly what constitute a Phantom Read. Does it include ONLY the case where ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 06:56 AM
dd
 
Posts: n/a
Default Phantom Read

I am a bit confused by exactly what constitute a Phantom Read. Does it
include ONLY the case where ADDITIONAL rows have been added during 2
queries. Then what about rows DELETED between 2 queries? I have this
concern because many textbooks do define Phantom read as addition of rows
but never mention anything about removed rows.

If Oracle or any database says its Serializable isolation level does prevent
Phantom Read, can I assume that it means no rows inserted nor DELETED
between 2 queries?

Thanks for any advice.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 06:56 AM
Robert Klemme
 
Posts: n/a
Default Re: Phantom Read

dd wrote:
> I am a bit confused by exactly what constitute a Phantom Read. Does
> it include ONLY the case where ADDITIONAL rows have been added during
> 2 queries. Then what about rows DELETED between 2 queries? I have
> this concern because many textbooks do define Phantom read as
> addition of rows but never mention anything about removed rows.


AFAIK "Phantom reads" just refer to rows added after an earlier read. If
you have deleted rows it's a nonrepeatable read. See chapter "Data
Concurrency and Consistency" of the Concepts document.

> If Oracle or any database says its Serializable isolation level does
> prevent Phantom Read, can I assume that it means no rows inserted nor
> DELETED between 2 queries?


Yes, because Serializable prevents phantom reads *and* nonrepeatable
reads.

Kind regards

robert

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-08-2008, 06:56 AM
Mark D Powell
 
Posts: n/a
Default Re: Phantom Read

dd, the drawback of serializable reads is that attempting to make
transactions run this way kills application performance. Either the
sessions single thread or error off because Oracle is unable to
serialize the transaction.

The Oracle concurrency model was chosen to provide high concurrent data
access while providing time consistent views of the data. You need to
give consideration to the effect of concurrent access to the data
involved in all multistatement transactions. The fact that writers do
not block readers is very important in situation such as where you try
to use table triggers to enforce referential integrity rules rather
than FK.

HTH -- Mark D Powell --

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:11 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com