Problem due to read consistency...

Hi,
Pls hv look on given scenario...
Two transactions updating the same row
Session 2's update waits until Session 1's commit release the row lock.
In Session 1
SQL>select color from cust where id=500;
color
red
SQL>update cust set color='blue' where id=500;
In Session 2
SQL> select color from cust where id=500;
color
red
SQL>update cust set color=green where id=500;
(Waiting...)
In Session 1
SQL> COMMIT;
In Session 2
SQL>select color from cust where id=500;
color
green
SQL>COMMIT;
Due to read consistency second user never knows that someone had changed color to 'blue'.
We can use flags etc to trap this.
Is there any way in Oracle to stop this logical inconsistency ....?

> I can use select ...for update for the purpose. but there r few reasons for
not using this...
We use JAVA with Oracle.
Not a valid reason. If the language is incapable, or the application server is incapable, then change it.
You cannot blame the RDBMS for not working when the problem is solely with the language/app server. And you will have the exact same problem with any RDBMS as the lock-row-before-updating is a fundamental RDBMS rule for protecting data integrity and guarding against lost updates.
> If Java program crashes then the lock not get automatically released from
Oracle.
I'm not sure that this is a valid statement. I deal with Java apps from JBoss against my databases and I've yet to see this problem.
But for the moment, let us assume you are correct - what happens when the Java app crashes after the UPDATE and before the COMMIT? The exact same problem. So how do you solve this? You cannot simply just ignore those locks and pretend that the locks created by the SELECT FOR UPDATE is a problem.
Also, why are your Java programs crashing so much? If it does not work, fix it or replace it.
> Any idea ?
You can use optimistic locking. This is not preferable. It results in a serious performance issue (and data concurrency issues) with any kind of higher volume OLTP system.
But when dealing with stateless clients (typical 3 tier architecture using web browser clients), there is no choice but to use optimistic locking. E.g.
SELECT c.* INTO :existing_row FROM cust WHERE id = :0
.. processing..
UPDATE cust
SET colour = :new_colour
WHERE custid = :0
AND cust_col1 = :existing_row.cust.col1
AND cust_col2 = :existing_row.cust.col2
AND cust_coln = :existing_row.cust.coln
In other words, the UPDATE checks that the row has not been changed since it was last "seen". If the UPDATE returns a 0 row result, it means that the row has changed. In which case the app needs to handle that exception somehow.

Similar Messages

  • Priemere Pro consistantly crashed upon export, I cleaned media cache and that seemed to help. Now export errors unknown problem... read to uninstall and reinstall and now I can not open up PPCS5

    Here is my problems with Premiere Pro CS5
    When I export a project... the computer crashes.
    I was able to get a tech chat and they would clean the media cache
    so I did that.
    Then, I got an export error "unknown problem" I then read in a forum to uninstall and reinstall Premiere pro
    Now on my very nice relatively newer IMAC, when I go to applications to open it... I can not find a purple tab to open it. It just has a presets folder, then open that and it has styles, templates, textures but, now little purple Pr to open or drag to my dashboard.
    Help PLEASE!!! I have wasted 20 hours of editing time, and work because of crashes, and problems.

    Here is my problems with Premiere Pro CS5
    When I export a project... the computer crashes.
    I was able to get a tech chat and they would clean the media cache
    so I did that.
    Then, I got an export error "unknown problem" I then read in a forum to uninstall and reinstall Premiere pro
    Now on my very nice relatively newer IMAC, when I go to applications to open it... I can not find a purple tab to open it. It just has a presets folder, then open that and it has styles, templates, textures but, now little purple Pr to open or drag to my dashboard.
    Help PLEASE!!! I have wasted 20 hours of editing time, and work because of crashes, and problems.

  • My macbook pro was repaired and since then i can't get nor photoshop or bridge to initialize. a window appears that says it has  initializing problems due to an icc profile issue.

    my macbook pro was repaired and since then i can't get nor photoshop cs5 or bridge cs5 to initialize. a window appears that says it has initializing problems due to an icc profile issue.
    there appear two error messages. the first one says that there has been a problem sincronizing because of a programme error. the second one appears after you clicked ok on the first window and says that photoshop couldn't be initialized because the icc profile is invalid.
    does anyone know if i have to delete any system or photoshop preference? the illustrator is also having troubles. thanks

    thanks! what finnally worked better was renaming the «settings» folder in te «color folder» in the library with ~before the name. now indesign is asking me for thw icc profiles but still works, so i asume i can reinstall color settings only for indesign and go on.

  • Read consistency with compound query

    Does read consistency work for the whole compound query or does it work only for every single query in the compound query ?
    I mean if I issue the following statement
    select * from TABLE
    union all
    select * from TABLE
    if in the mean time an update has taken place on the table by an other session and also a commit is it possible that the second part of the union query to see that update ?
    Thanks

    My real life problem is the following:
    I have a movements table and an online_stoc table, I keep the online_stoc table sincronized with the movements table using a trigger on the movements table.
    When I issue a statement
    select item, sum(qta_din), sum(qta_sta)
    from
    select item, sum(qta) qta_din, 0 qta_sta
    from movements
    group by item
    union all
    select item, 0 qta_din, qta qta_sta
    from online_stoc
    group by item
    having sum(qta_din) <> sum(qta_sta)
    it should not give anny rows back and I almost always see this correct result.
    But I experienced one time that this query gave back a line and after a checking I saw that during the query execution time there was an insert transaction on the table movements that commited during te query.
    So I don't understand how was it possible.
    Thanks

  • HT1386 has anyone ever had synch problems due to "PAIRING RECORD IS MISSING

    Has anyone ever had synch problems due to "Pairing record missing"?   Just downloaded new IOS on my computer and this is what message came up

    Try rebooting your computer.

  • Collation problem in Acrobat Reader X

    I have a collation problem with Acrobat Reader X and HP LaserJet M2727 nf (using HP Universal Printing PCL 6 driver)
    When printing multiple copies of a PDF, the result is always in the order 1,2,3 1,2,3 etc. (for a 3 page document for example)
    This is the case even when I uncheck the default collate option.
    How can I disable the collation option in this version?
    Thanks,
    Eran

    HELP!  This is a killer problem.   Everyone is banking on PDF documents and Adobe Reader.  YOU CAN NOT IGNORE THIS ANY MORE!
    There was a registry setting in Reader 8 to force host collation.. it doesn't work any more.  Please respond immediately !!!!

  • Problem with adobe reader x (10.0.1) error 1327 message. invalid drive: H:\

    I AM HAVING A PROBLEM W ADOBE READER X (10.0.1)  IT GIVES ME A ERROR 1327 MESSAGE  INVALID DRIVE: H:\
    I CAN NOT DELETE IT OR OPEN IT OR DO ANYTHING . WHEN IT TRIES TO REINSTALL IT BRINGS UP SCREEN ;
    SET UP WAS INTERRUPTED BEFORE ADOBE READER X (10.0.1) COULD BE INSTALLED. YOUR SYSTEM HAS NOT BEEN MODIFIED.

    O/P reports issue as resolved in http://forums.adobe.com/thread/1127028

  • Problem with Adobe Reader not being able to run with Maverick  10.9.2?

    problem with Adobe Reader not being able to run with Maverick  10.9.2?

    Have you updated your version of Adobe Reader?

  • Problem with Adobe Reader and IE

    I'm using Vista Home Premium and IE9 with the latest Reader available.  Starting yesterday, I cannot read PDF files on the web.  This is a new problem.  I tried to download newer versions of IE and the Reader, but both tell me I've got the newest versions I can use.
    I have no problem with Firefox.  Just IE.  I prefer using IE.  Can someone guide me -- without using technical language.  Many thanks!!

    Thanks for your input.  I opened the standalone Adobe Reader X, clicked Edit, Preferences, Security, Advanced Preferences.  Then clicked each of the 3 tabs on top, but nothing looked like "Protected Mode."
    Then I went back and clicked Security (Enhanced) and unchecked Enable Enhanced Security.  Tested this change, but I still get the gray screen and messages:  "A problem has caused IE to close."  "A problem with this website has caused IE to close and re-open the tab."  I then went back and re-checked Enable Enhanced Security.
    I should mention that I have used this particular website for about 10 years and never had a problem.  But I now have the same problem with any online PDF that I try to open using IE.
    Can you think of anything else?  If not, here's my plan of attack.  Please let me know if you think it will work.
    1)  Copy over all my favorite sites from IE to Firefox.  (I've already started doing that.)
    2)  Uninstall IE and re-install it.
    3)  If I still have a problem, uninstall Adobe Reader and re-install it.
    Do you think this will do the job if all else fails?
    Many, many thanks for the time you have put into this.

  • Problem with adobe reader, commenting

    one of our authors is using adobe reader x 11,1, and I send him a pdf (enabled commenting and measuring), but for some reason the commenting-fields does not show on his screen?
    should I save the pdf in another way?

    What do you mean by "commenting fields" exactly? By “commenting filds” I mean the tools in top of the page – delete, highlight etc. When I send the pdf, I save it as “file - save as -  reader extended pdf – enable commenting and measuring”, otherwise the commenting tools normally don’t appear by the author.
    Are they existing comments? no, it is the text in his pdf-book he needs to correct
    Is he able to access the commenting tools? no
    You can try sending a non-enabled version since Reader 11 can add comments to a non-enabled document. will try that J
    Fra: George Johnson [email protected]
    Sendt: 6. november 2012 16:16
    Til: Forlagene Idag & Nordan
    Emne: problem with adobe reader, commenting
    Re: problem with adobe reader, commenting
    created by George Johnson <http://forums.adobe.com/people/George_Johnson>  in Creating, Editing & Exporting PDFs - View the full discussion <http://forums.adobe.com/message/4826849#4826849

  • Continued problems with Adobe Reader 9.3.1

    Adobe Reader stops at the half-way mark in the progress block when loading a form to print.  Cannot get this fixed. Does anyone out there have a fix for this.  Is Adobe even recognizing that there is a problem with this.  Error message keeps telling me that there is a problem with Adobe Reader, exit and try again.

    I haven't been able to print any .pdf files since I downloaded 9.3.
    My message says Internet Explorer has closed it down because of data executable files.  I've changed my DEF settings to allow
    Adobe Reader but it still doesn't work.  I never had any problems before with newer versions.

  • Problems in Adobe Reader when I open a pdf file

    I have problems in Adobe Reader when I open a pdf file, the menu bar appears blank without options and when I pass the mouse over the bar she disappears. I uninstalled and reinstalled Adobe Reader and to no avail. Could anyone help in this case.

    Manuel Sobreira wrote:
    My version is already the most current, Kaspersky Internet Security 2015 15.0.0.463 (b).
    That is the old version that causes the problem; you need to update to the latest version (15.0.2.361).

  • Having problem with adobe reader

    Hi,
    I have a problem with adobe reader in my cell phone E71 model recently.I could open any pdf files till yesterday,but now without any reason the adobe reader icon in the office folder does not open.I wanna know what should I do.

    Might be some problem with adobe reader. You may Google another pdf app called pdf plus. Install it and see if the problem is solved or not.
    Nokia C7

  • The display problem of Adobe Reader 11.0.09

    Hi, everyone,
    My operation system is Windows XP SP3 Professional.
    I encountered a strange display problem of Adobe Reader 11.0.09.
    The problem happened not only at Adobe Reader 11.0.09 Chinese Traditional, but also English United States.
    The display problem such as two pictures as follow.
    The strange problem was that menu bar covered by toolbar items or disappeared.
    Please tell me how to resolve the problem.
    Thanks a lot.

    Thanks for your help, Ajlan huda.
    Could you tell me where I could find the system requirement about Adobe Reader patch 11.0.09?
    I couldn't find any information about system requirement of Adobe Reader patch 11.0.09.
    I knew Adobe Reader 11 could install on Windows XP SP3 just all.
    I could install and upgrade Adobe Reader to 11.0.09 as the following picture.
    I will roll back the version of Adobe Reader from 11.0.09 to 11.0.07 and test the problem appear or not.

  • Mobile circuit problem due to technical problem wi...

    i bought nokia C3 with one year warranty.
    once it had some problem due to water falling on it..i repaired it with other agency.
    after some time its circuit was short and it stopped working..when i consulted nokia care for the same,they were not ready to take the responsibility for the same..
     this is my second Nokia mobile in which i had a loss..of around INR 6000/-
    i can't bear this amount every time..i suggest you to take a corrective action and pls do the needful..ASAP..so that i can have a clear idea about the further action to be taken against you.

    How is Nokia Care responsible if you got your set repaired at non Nokia care place(voids terms of warranty) after spilling water on it ( which also voids terms of warranty)?
    Please mark the post as solution if it solves your problem.
    Current Device - Nokia Lumia 1020/920

Maybe you are looking for

  • Is there a way to find out my Apple Care serial?

    Firstly, I'm new here so if this is in the wrong section then I apologise now I recieved my MacBook Pro 13" in September '10 for my 18th Birthday off my Dad. My Dad says he remembers buying Apple Care for my MacBook but because I was an Apple N00b ba

  • My iPod touch is frozen?

    Just wanting to know if anyone knows what to do about this? Earlier I was syncing my iPod Touch and accidentally unplugged the cable. I thought nothing of it, plugged it back in and it continued and finished the sync. But when I took it out of my poc

  • Camera RAW 6.2 sharpening isn't used when open with Photoshop CS5.

    Greetings, Lately I've noticed when I sharpen a photo in Camera RAW 6.2, that sharpening isn't carried over when I open it in Photoshop CS5.  It doesn't mater if I open or open as a Smart Object. Also, I don't know weather this is associated or not,

  • Close app gesture in Windows 8.1 working erratically

    I have had my Helix since May and have since upgraded Windows to 8.1. Apart from the same sorts of problems others have described (digitiser pen not always working until you restart the service and noisy fans which I needed to install TPFC to cure),

  • How to add long text for existing static text in Adobe forms.

    Hi all, I have a requirement that I need to add  a long text for existing Static text in my adobe form 1) Counter part inputs 2) Mack Inputs. These two are static texts, I need to add the long text in the following manner. 1)Counter Part Inputs(zds22