Nonrepeatable Reads and Phantom Reads

Guys, I am very confuse about the definitions of Nonrepeatable Reads and Phantom Reads when I read the BEA Documentaion in http://e-docs.bea.com/workshop/docs81/doc/en/wls/guide/advanced/EJBsAndTransactions.html
The definition was queit confusing to me because they seems to describe the same thing, but it is obviously not the same thing. The problem is to see the difference among then.
What is that difference? Could I have an practical example of that difference?
Thanks everyone

Non-Repeatable reads: When a row is updated in database. 2 reads may not return same data.
Phantom reads is where a new row is inserted into the database, hence the 2 selects may not return same set of data.
Chekc the link below for example queies. hope it helps.
http://en.wikipedia.org/wiki/Isolation_(computer_science)
#Phantom_Reads

Similar Messages

  • Dirty reads vs phantom reads

    Hi,
    What is the difference between a "Dirty Read" and "Phantom Reads". Can anyone explain in brief or give an example?
    Thanks in advance.

    A dirty read is an uncommitted read, which may or may not be exist in the table. A phantom is a ghost record that doesn't appear in a transaction initially but appears if it is read again because some other transaction has inserted rows matching the criteria.
    Here are examples of both:
    --Dirty read example
    create table t1 (c1 int null, c2 varchar(50) null)
    go
    insert t1(c1, c2) values (1, 'one')
    insert t1(c1, c2) values (2, 'two')
    insert t1(c1, c2) values (3, 'three')
    insert t1(c1, c2) values (4, 'four')
    begin tran
    update t1 set c2 = 'zero'
    -- let this run in the current query window and open a new query window to run the below statement
    --and you will see all 4 rows having a value of 0 in column c2, which is uncommitted data
    select * from t1 with (nolock)
    --uncomment this and run the below statement and rerun the above statement
    --and you will see the previous values of one, two, three and four
    --rollback tran
    Here's an example of a phantom reads: 
    --Phantom example
    create table t1 (c1 int null, c2 varchar(50) null)
    go
    insert t1(c1, c2) values (1, 'one')
    insert t1(c1, c2) values (2, 'two')
    insert t1(c1, c2) values (3, 'three')
    insert t1(c1, c2) values (4, 'four')
    -- let this run in the current first query window and open a second query window to run the below statement
    --and you will see all 2 rows having a value in column c2 starting with character t
    begin tran
    select * from t1
    where c2 like 't%'
    --now insert the new value of ten (matching the query criteria - starts with t) from the first query window
    insert t1(c1, c2) values (10, 'ten')
    --Run the below statement again from the second query window that is open and you will see the new row
    --that got inserted - so 3 rows are seen including the newly inserted ten
    --this new row is a phantom read
    select * from t1
    where c2 like 't%'
    --uncomment this and run the below statement in the second query window
    --rollback tran
    Satish Kartan www.sqlfood.com

  • What is the difference of  public-read and  public-read protected

    I have noticed that the access of some variables in API document is public-read protected. I tried the following code. They seem all the same.
    class FatherClass{
    public-read var a;
    public-read protected var b;
    init{
        a=1;
        println(a);
        b=1;
        println(b);
    class SubClass extends FatherClass{
        init{
            a=4;
            println(a);
            b=4;
            println(b);
    var subClass=SubClass{};

    As you see in my code, subclass can write the variable with either public-read and public-read protected. What write access do the public-read protected widen? That's because your subclass is in the same script as the variable. Move the subclass to a separate script and it would not be able to write when the access is public-read.
    "public-read" = any code can read, code in the same script can write.
    "public-read protected" = any code can read, code in the same script, in the same package or in a subclass can write.

  • Find physical reads and logical reads ?

    Hi,
    how will find out physical reads and logical reads ?

    Well I would suggest you read the report from statspack/awr.They as suggested by Amit,have a load profile section.That would be helpful for you in finding the details of this thing. Also which version you are? If you are in 10g than the EM is able to give you a compare period report where you can compare 2 different days's periods information and can check which particular part has changed.
    In addition to this , look for the information of the metrics in the documentation.As the physical read and logical reads are statistics which are happening in the system.So from 10g onwards, oracle is keeping a track in the deflectionin the statistics. So if you see that than it willbe easy for you to manage and monitor it.
    I shall try to findthe name of some views related to it and post.
    Aman....

  • Difference between db file sequential read and scattered read

    Hi,
    Oracle Version : 10.2.0.1
    Operating system: Linux
    Can any one please help me what is the difference between db file sequential read and scattered read or please give any best related links .
    Thanks & Regards,
    Poorna Prasad.

    >
    A sequential read is a single-block read. Single block I/Os are usually the result of using indexes.
    A db file scattered read issues a scattered read to read the data into multiple discontinuous memory locations. A scattered read is usually a multiblock read. It can occur for a fast full scan (of an index) in addition to a full table scan.
    >
    See Performance Tuning Guide:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/instance_tune.htm#i20526
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/instance_tune.htm#i15958
    Edited by: P. Forstmann on 20 oct. 2009 09:11

  • Have downloaded both Adobe reader and PDF reader, but when I attempt to open a pdf from a site on safari, it starts to load, then disappears.  Any way to fix this?

    Have downloaded both Adobe reader and PDF reader, but when I attempt to open a pdf from a site on safari, it starts to load, then disappears.  Any way to fix this?

    Try quitting the PDF apps and Safari like I describe below. Then reset the iPad. After it starts try again.
    Double click the Home button to show the screen with running and recently used apps. Each app icon will have a sample page above it. Flick up on the page (not the app icon) and the page will fly away and the app icon will disappear. This quits that app. Then reset your device. Press and hold the Home and Sleep buttons simultaneously until the Apple logo appears. Let go of the buttons and let the device restart. See if that fixes your problem.

  • Differnce between byte[] reading and int[] reading

    While reading information from file using fileInputStream ....
    Is there any differnce between byte[] reading and int[] reading ?

    Well, in as much as you can do the former and not the latter.
    FileInputStream just reads blocks of bytes. If you want to read more sophisticated element you need to wrap in in a DataInputStream or a Reader.

  • Installed latest version of adobe reader and adobe reader pops up error message

    can someone help me
    I installed the latest version of adobe reader and I put my flash drive in my pc and it tells me can't read file because it was sent as email attachment and wasn't properly decoded
    I tried this flash drive on another computer and it works fine. I even tried to uninstall and reinstall checked for updates and no updates were available

    See http://helpx.adobe.com/acrobat/kb/pdf-error-1015-11001-update.html

  • AWR's buffer cache reads and logical reads

    In AWR report under "Segments by Logical Reads" section, there is a total logical reads, I assume it is in unit of block. Under "IOStat by Function summary" section, it has buffer cache reads in unit of bytes. Shouldn't the number of logical reads x 8k (if the block size is 8k) = the number of buffer cache reads?
    They are not equal, not even close, does anybody know why? Thanks

    Hi,
    buffer gets = number of times a block was requested from buffer cache. A buffer get always request in a logical read. Depending on whether or not a copy of the block is available in the buffer cache, a logical read may or may not involve a physical read. So "buffer gets" and "logical reads" are basically synonyms and are often used interchangeably.
    Oracle doesn't have a special "undo buffer". Undo blocks are stored in rollback segments in UNDO tablespace, and are managed in the same way data blocks are (they're even protected by redo). If a consistent get requires reading from UNDO tablespace, then statistics counters will show that, i.e. there will be one more consistent get in your autotrace.
    For more information and some examples, see a thread at askTom:
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:549546900346542976
    Best regards,
    Nikolay

  • Problem on Web Adobe Reader and Adobe Reader Web(firefox and Internet Explorer)

    Hello, my girlfriend's computer have been get into a serious problem on adobe reader.
    after she install the lastest version of adobe reader, when she open any of the pdf file,
    the pdf will hang down(crash) and all of the word in the pdf is blank, and also can't see any selection on the top of left hand side(File, Edit, View, windows, help, Print.. all of that).
    and that problem also same as adobe reader web,
    cant see, blank, hang down(crash), i have try to uninstall it and install again, but the problem still not solve, so i need helps form you kind guys, thanks a lot.
    Her Computer System is Window 7(i remember is home premium)
    dual core, 4g ram, and any thing you need i provide please tell me..thanks.

    Please let me know which version of Adobe Reader is installed on the system? You can check the same by clicking on Help > About Adobe Reader from within the Reader application.
    Also, could you try and repair the application from within the Control Panel > Programs and Features.

  • MIO 6601 Counter, Perform Buffered Read and Simple Read

    I have an application written in C++ where I would like to use the 6601 as the time base for all of the boards, so I would like to be able to query the current value of the counter. I also have a external signal that I want time tagged in the buffer. I have used example programs for the Simple Read and the Buffered read and they both work successfully individually.
    If I try and combine them by setting up the counter with the following statement:
    iStatus = GPCTR_Set_Application(iDevice, ND_COUNTER_3, ND_BUFFERED_EVENT_CNT);
    and try to read the current value of the counter with:
    iStatus = GPCTR_Watch (iDevice, ND_COUNTER_3, ND_COUNT, puiCurrentTime);
    I always return a 0 for puiCurrentTime.
    Can
    I do both with a single counter? If not can I synchronize two counters one setup for the buffered read the other for the simple read.
    Thanks

    The second NIDAQ function call (GPCTR_Watch) will not work with Buffered Acquisition, because it is designed for simple read only. That might be the reason why puiCurrentTime always returns a zero.
    Regarding the second issue, you can do both tasks with a single counter, by configuring it as buffered first, and completing the operation, and then configuring it as single, and completing also the operation. Nevertheless, there is no way to configure it as buffered and work with it as single reader, or viceversa. You must use two for performing an operation such as that. Thus, if you want to synchronize both of them, I would suggest you to read the following document which talks about it.
    Well, I hope all of this info is helpful for you.
    Aguila
    Attachments:
    Multicounter_Synchronization_App_Note.doc ‏55 KB

  • Older Reader and Newer reader

    My boss has some CDs that has some service manuals for his hobby cars on them. They require Acrobat Reader 4.0 to view. The CDs have 4.0 on them so you can download it. When I tried to download it I got a registry error but his manuals still open. He has Reader 9.0 (the newest one) already on his computer (running Vista) that didn't get removed with the 4.0 instal. I know that different versions of Adobe products can conflict with each other but now that I have 4.0 "somewhat" on there with 9.0 he can't view PDFs in his browser (he usually uses AOL).
    Does anyone have any ideas how I can fix his dilemma? He needs both as far as I can tell but I think there is a conflict. I'm not an IT person but I CAN follow directions. HELP!!!!

    I was afraid of the 4.0 not being compatible with Vista. I DO know that the 4.0 works on XP because my boss was using the disks that need 4.0 on a laptop that has XP on it. The laptop is SOOO Slow that he'd rather use his new computer but he may just have to dump a bunch of stuff off of the laptop to speed it up and use it for his manuals ONLY.
    Another quick question though....shouldn't you be able to view PDFs that used 4.0 on 9.0 or are they so far apart that the new can't read the old?

  • Synchronisation between pc reader and sony reader stopps while doing.

    when i open pc reader the synchronisation begins. but it stops every time after about 10 books.
    please help me

    when i open pc reader the synchronisation begins. but it stops every time after about 10 books.
    please help me

  • Read and Delivery Receipts

    My Blackberry Curve sends read and delivery receipts to the email sender and to my email. Many times I don't even open the message. In my BB email options, I have NO marked on confirm delivery, confirm read and send read receipts. Does anyone know how to make these stop sending?

    open messages icon - menu - options - email settings - make sure it shows your email beside MESSAGE SERVICE
    change CONFIRM DELIVERY and CONFIRM READ  and READ RECEIPTS to NO

  • Maint. Status in Dictionary: Maintain View- setting read and insert only.

    I am creating a maint. view for a custom table I have created.  Say the view was accessed via sm30, the user should be able to view existing records and insert new records, but not delete or change existing records.
    When in the Dictionary:Maintain View (from se11), I am on the Maint. Status tab and I see several options for access:
    -read only
    -read, change, insert, delete
    -read and change
    -read and change (time specific)
    The problem is, there is no option for READ and INSERT.  Does anyone know how to limit the access to this?
    Thanks,
    Aaron

    A workaround is to allow everything in DDIC and modify the function's PAI (se30 generation) to disallow whatever you want.
    Best!
    Jim

Maybe you are looking for

  • Error when fetching into a variable of ROWTYPE

    I came across with a vied error when creating the body of a method. Problem: I have a Type called Emp_typ and a corresponding table Emp_tab. When I create the body of get method it gives the following error msg : Compilation errors for PACKAGE BODY C

  • 3D performance problems after upgrading memory

    I recently purchased an additional 2GB of memory to try and extend the life of my aging computer.  I installed the memory yesterday and Windows seems to recognize it (reporting now 3.3GB) but when I dropped into WoW (pretty much the only game I have)

  • HTML in Java best practices?

    I have developed an application that performs some data analysis. When the data is analyzed I create a result file in XML using JDOM. This information is then transformed into HTML using XSLT (xalan). The resulting HTML is launched in the standard br

  • Deactivating Font Book

    I got so fed up of Font Book I download another Font Management software. What I'd like to know is will Font Book still be running in the background as well as the new font software? One of the reasons why I was using Font Book was to deactivate all

  • Importing Encore CS6 menus into Photoshop CC

    So, I'm faithfully cruising the web and the forums looking for answers to this question, and that is: "How do I import an Encore menu into Photoshop now that the Dynamic link functionality no longer works with Encore CS6 and any of the CC suite. I'm