Tracing lost updates

situation is that probably currently application suffers from lost updates. but it must be proved :) pure update statements were rewritten into select for update nowait so that in case updates conflicts one of them will be interrupted suggesting that indeed lost update was going to happen, which can be traced more deeply to be 100% sure. and here is the question: is it possible to get more detailed information about which particular row/rows/session prevented select for update nowait to be successful? I would like to have most data gathered possible during unsuccessful select for update.
generally I'm looking for a solution. If you have more adequate approach please share, I will think how it is applicable within my current situation (permissions etc.).
thanks

943276 wrote:
situation is that probably currently application suffers from lost updates. but it must be proved :) pure update statements were rewritten into select for update nowait so that in case updates conflicts one of them will be interrupted suggesting that indeed lost update was going to happen, which can be traced more deeply to be 100% sure. and here is the question: is it possible to get more detailed information about which particular row/rows/session prevented select for update nowait to be successful? I would like to have most data gathered possible during unsuccessful select for update.
generally I'm looking for a solution. If you have more adequate approach please share, I will think how it is applicable within my current situation (permissions etc.).There definitely is:
You are resorting to a Pessimistic approach to counter Lost Updates. There is an Optimistic approach too.
1. Use of Timestamp:
You will have to add a new Column (if not existed) that shall be populated with the SYS_TIMESTAMP, every time a DML activity occurs on each row. This new column shall be updated via a Trigger on table.
Logic for DML would go as follows:
1. Fetch the current timestamp of the record to be modified.
2. While updating, add the Timestamp condition to the Where predicate. Thus ensuring, if another session has already updated the record, the current update will not over-write the same.2. Use of Checksum:
You will have to add a new column that will store the hash value of combination of columns, preferentially the columns participating in Primary key.
1. Fetch the current checksum of the record to be modified.
2. While updating, add the checksum condition to the Where predicate. Thus ensuring, if another session has already updated the record, the current update will not over-write the same.

Similar Messages

  • Demonstrating lost update problem

    Hi
    I would like to know if it's possible to demonstrate the 'lost update' problem in oracle without using simulation. If so how would I go about doing this? I assume I will need to establish multiple sessions within a single transaction in order to have independent transactions to demonstrate this properly.
    Thanks.

    The type of behaviour that leads to a lost update can be demonstrated with something like this.
    In session 1 run a pl/sql block like:
    BEGIN
       FOR r IN (SELECT * FROM t ) LOOP
          IF r.id = 5 THEN
             DBMS_OUTPUT.Put_Line ('ID is '||r.id||' and descr is '||r.descr);
             DBMS_LOCK.Sleep(30);
             UPDATE t SET descr = 'SLEEPY' WHERE id = r.id;
          END IF;
       END LOOP;
       COMMIT;
    END;The Sleep simulates user thinking time, or perhaps some delay in the proce for complex calculations and lookups.
    While session 1 is busy, in session 2 do
    SQL2> UPDATE t SET descr = 'AWAKE' WHERE id = 5;
    1 row updated.
    SQL2> COMMIT;
    Commit complete.
    SQL2> SELECT * FROM t WHERE id = 5;
            ID DESCR
             5 AWAKEThen, when the block in session 1 is finished, you will see:
    ID is 5 and descr is ALL_CATALOG
    PL/SQL procedure successfully completed.
    Then do
    SQL1> SELECT * FROM t WHERE id = 5;
            ID DESCR
             5 SLEEPYThe update by session2 was lost.
    There are two ways to handle the situation. First, define the cursor as FOR UPDATE. In this case, session 2 would receive an error. The other way, optimistic locking, is to use something like the following as an update statement in the pl/sql block:
    UPDATE t SET descr = 'SLEEPY'
    WHERE id = r.id and
          descr = r.descr;Then check for the success of the update.
    TTFN
    John

  • Lost updates in cluster environment known problem?

              we are running weblogic clustered. We have an entity bean that is set to read-write
              (which means that in clustering no caching will be used as per your docs). We
              are hitting this entity bean from both servers at the same time, an update by
              one, and a read by the other. What is happening is that the update appears to
              get lost for lack of a better term. We have the update in a method that requires
              a transaction, and after this method is finished (which means the trasaction/db
              commit has completed) we have a finder method that returns the updated record.
              Then, we shut down the servers and look in the db, the row has NOT been updated.
              We found something in your docs about "lost updates". It said to set the isModified
              method in the ejb to always return true, this also did not help.
              Okay, we found issues just like this in posts to the bea newsgroups from 2000.
              We tried what was recommended by Rob Woolen, and it worked. We set the <delay-updates-until-end-of-tx>false</delay-updates-until-end-of-tx>.
              This has stopped this from happening. Any thought? Is this really a true fix?
              Thanks all...
              

              We have db-is-shaed to true.
              Also, its not that one server is overwriting what the second server does, its
              that one server is doing multiple reads as the other server doing the update.
              Then the update never gets to the db, even after the servers are both brought
              down, its still not there, even though we do a find after the update tranaction
              completes, and it returns an updated row! Ugh...
              "Cameron Purdy" <[email protected]> wrote:
              >Transactional control does not stop lost updates. If the second server
              >overwrites the cahnges made by the first, then the update will be lost.
              >
              >The question is this: What behavior do you actually want? Do you want
              >the
              >update on one server to disallow the update on the other server? If so,
              >explain your reasoning.
              >
              >What you should have is a means to ensure data integrity, which is to
              >say
              >that your transactions should not be able to complete if another
              >transactionchanges necessary data during the course of the transaction.
              >That
              >is usually accomplished by employing version or timestamp columns.
              >
              >Peace,
              >
              >--
              >Cameron Purdy
              >Tangosol Inc.
              >Tangosol Coherence: Clustered Coherent Cache for J2EE
              >Information at http://www.tangosol.com/
              >
              >
              >"ralph" <[email protected]> wrote in message
              >news:[email protected]...
              >>
              >> we are running weblogic clustered. We have an entity bean that is set
              >to
              >read-write
              >> (which means that in clustering no caching will be used as per your
              >docs).
              >We
              >> are hitting this entity bean from both servers at the same time, an
              >update
              >by
              >> one, and a read by the other. What is happening is that the update
              >appears
              >to
              >> get lost for lack of a better term. We have the update in a method
              >that
              >requires
              >> a transaction, and after this method is finished (which means the
              >trasaction/db
              >> commit has completed) we have a finder method that returns the updated
              >record.
              >> Then, we shut down the servers and look in the db, the row has NOT
              >been
              >updated.
              >> We found something in your docs about "lost updates". It said to set
              >the
              >isModified
              >> method in the ejb to always return true, this also did not help.
              >>
              >> Okay, we found issues just like this in posts to the bea newsgroups
              >from
              >2000.
              >> We tried what was recommended by Rob Woolen, and it worked. We set
              >the
              ><delay-updates-until-end-of-tx>false</delay-updates-until-end-of-tx>.
              >> This has stopped this from happening. Any thought? Is this really a
              >true
              >fix?
              >>
              >> Thanks all...
              >>
              >
              >
              

  • All data lost updating

    I lost all my data updating my Ipad with iOS5, pictures, files, etc.
    What can I do to recover it. Also system was asking for a backup password, which I don't have.. what can i do?

    I'm not sure if that will work, iTunes have already exported my music library and the music contained inside the iPod isn't located inside this computer. So it should means that iTunes will sync the music library, not from the lost data. This situation stands at updating my iPod this morning and it eradicated all the previous music data it have inside, I've tried to restore from backup but only able to restore on two time periods.
    Message was edited by: Apple2011

  • Tracing in Update Task

    Hello together,
    is there any posibillity to trace an function module that runs in update task mode?
    I try to save some data in a table but this doesen't work reliable...
    Thomas

    Hi Thomas,
    We could do that by using the following syntax
    CALL FUNCTION update_function IN UPDATE TASK
                                 [EXPORTING p1 = a1 p2 = a2 ...]
                                 [TABLES t1 = itab1 t2 = itab2 ...].
    Or use the update debugg mode to trace out.
    Thanks,
    Sunil

  • Lost updated iWeb work

    Hi!
    I don't know what to do and really need some help! I've been updating my website on iweb for the last month now but when I logged on today I could only find the work that I already have published, and not the data that I was still working on! I had added pages and deleted things..
    I don't know if it's because I updated to Lion or iLife11 that my work has gone missing..
    But anyway I tried googling the solution today, which told me to find a file called Domain.sites2. I've searched for it in spotlight, still can't find it.
    I went to Macintosh HD/Users/Your username/Library/Application Support/iWeb/.. or well I tried.. but I can't find iweb in it! Everything else is there.. iwork etc..
    What's happening? Is my work gone?
    Grateful some help and insight to my problem!

    In Lion the Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.
    NOTE: If you repair disk permissions with Disk Utility on your boot drive you will have to rerun the script with Terminal to make the Library folder visible again.
    For opening your domain file in Lion for the first time or to switch between multiple domain files  Cyclosaurus has provided us with the following script that you can make into an Applescript application with Script Editor. Open Script Editor, copy and paste the script below into Script Editor's window and save as an application.
    Just launch the applicaiton, find and select the domain file you want to open and it will open with iWeb. It modifies the iWeb preference file each time it's launched so one can switch between domain files.
    do shell script "/usr/bin/defaults write com.apple.iWeb iWebDefaultsDocumentPath -boolean no"delay 1
    tell application "iWeb" to activate
    Or you can download an already compiiled version with this link: iWeb Switch Domain.
    OT

  • RETRIEVING LOST UPDATES

    Yesterday, I downloaded Photoshop and Premier elements 11 to my computer.
    This morning on start up there were updates for both programs showingon the screen.  Computer froze before download was complete.  On reboot, message was not present.
    How do I recover update message for downloading?
    Thanks

    open photoshop and click help>updates.  do the same for premier elements.

  • Lost January Update on preowned Touch

    I bought a used Touch on ebay and was told it had the January update on it. It is not there. What can I do to recover the lost update. The seller has recently assured me the update was purchased but may have been lost when she deleted files. Any ideas?

    Hi albourrie,
    She will have to send you the "iPod touch App Pack 4A93.ipa" file, as well as her iTunes account information (Apple ID and password).
    If you can't get this data, I would recommend you to wait until June, because we will have to pay for the 2.0 Upgrade (if you're interested in), which also include the current features.
    Hope this helps!
    !http://signatures.mylivesignature.com/54486/122/A57996D55BE7ABB4A67DE686D381A27 4.png!

  • ADF BC: Creating updatable VO based upon DB View with "instead of" trigger

    Hello all,
    I have got an interesting issue. I have an Oracle DB view that is used to hide some complexity in the underlying DB design (it does some unions). This view is updatable because we have created an "instead of" update trigger to update the correct table when a row is updated. This is working fine in SQL.
    Next, we have created an ADF Entity object based upon the view, specifying an appropriate PK for the DB View. Then, we have created an updatable VO based upon the EO. All well and good so far. The issue we have is in trying to commit changes to the DB - because the ADF BC framework is trying to lock the row to update (using SELECT ... FOR UPDATE), it's not working because of ORA-02014 - cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc.
    This leads me to thinking about overridding doSelect() on the EO as hinted here http://radio.weblogs.com/0118231/stories/2005/07/28/differenceBetweenViewObjectSelectAndEntityDoselectMethod.html
    As a temporary test, we have over-ridden the EO's doSelect to call super.doSelect(false) and it does work, although we will have lost update issues as detailed in Steve's article.
    My questions:
    1). Is overriding doSelect() the correct thing here? Perhaps there is a better way of handling this problem? I do have a base EO class from which all of the EO's extend, so adding this behavior should be straightforward.
    2). Does anyone have example doSelect implementation? I am thinking of overriding doSelect for my EO and calling super.doSelect (lock=false), but then I need to deal with some possible exceptions, no?
    Kind regards,
    John

    Hi John,
    I have exactly the same issue as you experienced back in January. I have a complex data modelling requirement which requires the need to pivot rows into columns using ROW_NUMBER() and PARTITION clauses. To hide the complexity from the middle tier, I have created a database view and appropriate INSTEAD OF triggers and mapped my EO to the view. I have overriden the lock() method on the EO implementation class (to avoid ORA-02014) and would like to try the same solution you used with the pl/sql call to lock the record.
    My question is, how did you manage the release of the lock if the transaction was not rolled back or committed by your application i.e. if the user closed the browser for instance.
    In my naivity, I would like to think that the BC4J framework would release any locks for the database session when it found the servlet session to be terminated however my concern is that the lock would persist and cause complications.
    Any assistance greatly appreciated (if you would be willing to supply your lock() method and pl/sql procedure logic I would be even more grateful!).
    Many thanks,
    Dave
    London

  • Detection of Updating mode

    Hello everybody,
    We can upload Sales order using BDC, LSMW, BAPI or IDOC. Once the document no gets generated can we say by which method the document got generated ie by  using BDC, VA01, LSMW, BAPI or idoc. If yes, I want to know how. Suppose there is one sales order which got created six months back, can we tell how was it created.
    Regards
    Debopriyo Mallick

    J.K.
    Turn out that member listener approach still have chance to lost update notification.
    We found out that the update occurred between MemberLeft event notification and re-add map listener will be lost.
    That window is small, however, our business requirement require that no lost of update event at all as long as the update operation succeeded (the update could be performed by another extend client connect to different proxy node).
    Is it even possible to ensure that requirement using extend client?
    Regards,
    Chen

  • Best approach to Update / Delete / Insert

    Hi Guys
    I was flicking through my HTML DB Oracle University course notes the other day and was reading about onSubmit processes that are carried out after page submission / computations and validations.
    The example cited was for an insert statement using form items.
    At the bottom there was a warning that this approach should not be used for Updates / Deletes. Why is this?
    I have a custom built form that inserts into 3 tables so the out of the box functionality of HTML DB will not suffice. Instead i created an onSubmit processes that performs the inserts using many of the form items and a few sequences etc.
    This works fine but I also have to do a similar form for updates across many tables based on the users input.
    I was just curious why you should not use an onSubmit process to do updates / deletes? and any best practices that I should be adhering to.
    Cheers for any help
    Duncan

    Hello Duncan,
    I believe the warning is not about using what you call onSubmit processes, but how to use them in case of update and delete.
    When you are inserting a new data into a table, you don't really need to care about what is going on with the other users of the application. This is not the case when you update or delete a record. Prior to doing that you must verify that other users do not rely on that record in their processes. If they are, you must deal with that. If you are using the built in Automatic DML process it's doing it for you. If you are coding it manually, you must do it yourself.
    You should search for "lost update" or "optimistic lock" to learn more about this.
    Regards,
    Arie.

  • Pros and  cons  of  select  for  update  clause

    hi,
    Can anybody explain what are the
    pros and cons of select for update clause
    11.2.0.1

    As commented, there are no pros versus cons in this case.
    What is important is to understand conceptually what this do and why it would be use.
    Conceptually, a select for update reads and locks row(s). It is known as pessimistic locking.
    Why would you want to do that? Well, you have a fat client (Delphi for example) and multiple users. When userA updates an invoice, you want that invoice row(s) locked and prevent others from making updates at the same time. Without locking, multiple users updating the same invoice will result in existing updated data being overwritten by old data that also has been updated. A situation called lost updates.
    For web based clients that are stateless, pessimistic locking does not work - as the clients do not have state and pessimistic locking requires state. Which means an alternative method to select for update needs to be used to prevent lost updates. This method is called optimistic locking.
    So it is not about pros versus cons. It is about understanding how the feature/technique/approach works and when to use it.. and when it is not suited to use it. All problems are not nails. All solutions are not the large hammer for driving in nails.

  • Missing Update Rules for 0IC_C03 in Business Content

    We had a problem with 0IC_C03,  so we decided to reload from Business Content and then migrate to 7.0 format again.
    However, when we try to gather all of the dependent objects for the InfoCube in Business Content, we only get one set of obsolete update rules (2LIS_40_S278), and the update rules for 2LIS_03_BX, 2LIS_03_BF, 2LIS_03_UM do not show up.  They do not appear under update rules, either.
    I know they were there at one point because I activated and migrated the cube once already.
    Can someone help us find our lost update rules?

    Hi Dan,
    There are no update rules deliverd with BI 7.0 for 0IC_C03. There are only
    transformations Delivered as part of the content. In the new release
    Transformation replace the update rules and the transfer rules.                                                                               
    You have the 3 data sources and the associated transformations to  
    upload data to the infoCube.                                                                               
    Transformations installed                                          
    TRCS 2LIS_03_BF_TR -> CUBE 0IC_C03                                 
    TRCS 2LIS_03_BX_TR -> CUBE 0IC_C03                                 
    TRCS 2LIS_03_UM_TR -> CUBE 0IC_C03                                                                               
    DataSources installed                                             
    2LIS_03_BF                                                        
    2LIS_03_UM                                                        
    2LIS_03_BX

  • If shynchronise andi update my ipad ios4.3.3 to ios5.1 the

    If i shynchronise my ipad and update to ios5 then
    Can i shychronise again in any shops for download apps
    Or i will lost updateing of ios5 if i shychronise to another pc of any shop
    I want to know bcaz i will update now ios5
    Can i get any harm on my ipad or ios5.1 is good
    Or after update to ios5 then i have download all apps or all will stayble in my ipad
    All apps i download to self id purchase to app store
    So can i shynchronise to another pc

    You can only sync to one computer. If you sync to another computer all your apps will be deleted.
     Cheers, Tom

  • Select for update gives wrong results. Is it a bug?

    Hi,
    Select for update gives wrong results. Is it a bug?
    CREATE TABLE TaxIds
    TaxId NUMBER(6) NOT NULL,
    LocationId NUMBER(3) NOT NULL,
    Status NUMBER(1)
    PARTITION BY LIST (LocationId)
    PARTITION P111 VALUES (111),
    PARTITION P222 VALUES (222),
    PARTITION P333 VALUES (333)
    ALTER TABLE TaxIds ADD ( CONSTRAINT PK_TaxIds PRIMARY KEY (TaxId));
    CREATE INDEX NI_TaxIdsStatus ON TaxIds ( NVL(Status,0) ) LOCAL;
    Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (100101, 111, NULL);
    Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (100102, 111, NULL);
    Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (100103, 111, NULL);
    Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (100104, 111, NULL);
    Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (200101, 222, NULL);
    Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (200102, 222, NULL);
    Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (200103, 222, NULL);
    --Session_1 return TAXID=100101
    select TAXID from TAXIDS where LOCATIONID=111 and NVL(STATUS,0)=0 AND rownum=1 for update
    --Session_2 waits commit
    select TAXID from TAXIDS where LOCATIONID=111 and NVL(STATUS,0)=0 AND rownum=1 for update
    --Session_1
    update TAXIDS set STATUS=1 Where TaxId=100101;
    commit;
    --Session_2 return 100101 opps!?
    --Session_1 return TAXID=100102
    select TAXID, STATUS from TAXIDS where LOCATIONID=111 and NVL(STATUS,0)=0 AND rownum=1 for update
    --Session_2 waits commit
    select TAXID, STATUS from TAXIDS where LOCATIONID=111 and NVL(STATUS,0)=0 AND rownum=1 for update
    --Session_1
    update TAXIDS set STATUS=1 Where TaxId=100102;
    commit;
    --Session_2 return 100103                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    This is a bug. Got to be a bug.
    This should be nothing to do with indeterminate results from ROWNUM, and nothing to do with read consistency at the point of statement start time in session2., surely.
    Session 2 should never return 100101 once the lock from session 1 is released.
    The SELECT FOR UPDATE should restart and 100101 should not be selected as it does not meet the criteria of the select.
    A statement restart should ensure this.
    A number of demos highlight this.
    Firstly, recall the original observation in the original test case.
    Setup
    SQL> DROP TABLE taxids;
    Table dropped.
    SQL> 
    SQL> CREATE TABLE TaxIds
      2  (TaxId NUMBER(6) NOT NULL,
      3   LocationId NUMBER(3) NOT NULL,
      4   Status NUMBER(1))
      5  PARTITION BY LIST (LocationId)
      6  (PARTITION P111 VALUES (111),
      7   PARTITION P222 VALUES (222),
      8   PARTITION P333 VALUES (333));
    Table created.
    SQL>
    SQL> ALTER TABLE TaxIds ADD ( CONSTRAINT PK_TaxIds PRIMARY KEY (TaxId));
    Table altered.
    SQL>
    SQL> CREATE INDEX NI_TaxIdsStatus ON TaxIds ( NVL(Status,0) ) LOCAL;
    Index created.
    SQL>
    SQL>
    SQL> Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (100101, 111, NULL);
    1 row created.
    SQL> Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (100102, 111, NULL);
    1 row created.
    SQL> Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (100103, 111, NULL);
    1 row created.
    SQL> Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (100104, 111, NULL);
    1 row created.
    SQL> Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (200101, 222, NULL);
    1 row created.
    SQL> Insert into TAXIDS (TAXID, LOCATIONID, STATUS) Values (200102, 222, NULL);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> Original observation:
    Session1>SELECT taxid
      2  FROM   taxids
      3  WHERE  locationid    = 111
      4  AND    NVL(STATUS,0) = 0
      5  AND    ROWNUM        = 1
      6  FOR UPDATE;
         TAXID
        100101
    Session1>
    --> Session 2 with same statement hangs until
    Session1>BEGIN
      2   UPDATE taxids SET status=1 WHERE taxid=100101;
      3   COMMIT;
      4  END;
      5  /
    PL/SQL procedure successfully completed.
    Session1>
    --> At which point, Session 2 returns
    Session2>SELECT taxid
      2  FROM   taxids
      3  WHERE  locationid    = 111
      4  AND    NVL(STATUS,0) = 0
      5  AND    ROWNUM        = 1
      6  FOR UPDATE;
         TAXID
        100101
    Session2>There's no way that session 2 should have returned 100101. That is the point of FOR UPDATE. It completely reintroduces the lost UPDATE scenario.
    Secondly, what happens if we drop the index.
    Let's reset the data and drop the index:
    Session1>UPDATE taxids SET status=0 where taxid=100101;
    1 row updated.
    Session1>commit;
    Commit complete.
    Session1>drop index NI_TaxIdsStatus;
    Index dropped.
    Session1>Then try again:
    Session1>SELECT taxid
      2  FROM   taxids
      3  WHERE  locationid    = 111
      4  AND    NVL(STATUS,0) = 0
      5  AND    ROWNUM        = 1
      6  FOR UPDATE;
         TAXID
        100101
    Session1>
    --> Session 2 hangs again until
    Session1>BEGIN
      2   UPDATE taxids SET status=1 WHERE taxid=100101;
      3   COMMIT;
      4  END;
      5  /
    PL/SQL procedure successfully completed.
    Session1>
    --> At which point in session 2:
    Session2>SELECT taxid
      2  FROM   taxids
      3  WHERE  locationid    = 111
      4  AND    NVL(STATUS,0) = 0
      5  AND    ROWNUM        = 1
      6  FOR UPDATE;
         TAXID
        100102
    Session2>Proves nothing, Non-deterministic ROWNUM you say.
    Then let's reset, recreate the index and explicity ask then for row 100101.
    It should give the same result as the ROWNUM query without any doubts over the ROWNUM, etc.
    If the original behaviour was correct, session 2 should also be able to get 100101:
    Session1>SELECT taxid
      2  FROM   taxids
      3  WHERE  locationid    = 111
      4  AND    NVL(STATUS,0) = 0
      5  AND    taxid         = 100101
      6  FOR UPDATE;
         TAXID
        100101
    Session1>
    --> same statement hangs in session 2 until
    Session1>BEGIN
      2   UPDATE taxids SET status=1 WHERE taxid=100101;
      3   COMMIT;
      4  END;
      5  /
    PL/SQL procedure successfully completed.
    Session1>
    --> so session 2 stops being blocked and:
    Session2>SELECT taxid
      2  FROM   taxids
      3  WHERE  locationid    = 111
      4  AND    NVL(STATUS,0) = 0
      5  AND    taxid         = 100101
      6  FOR UPDATE;
    no rows selected
    Session2>Of course, this is how it should happen, surely?
    Just to double check, let's reintroduce ROWNUM but force the order by to show it's not about read consistency at the start of the statement - restart should prevent it.
    (reset, then)
    Session1> select t.taxid
      2   from
      3    (select taxid, rowid rd
      4      from   taxids
      5      where  locationid = 111
      6      and    nvl(status,0) = 0
      7      order by taxid) x
      8   ,  taxids t
      9   where t.rowid = x.rd
    10   and   rownum = 1
    11   for update of t.status;
         TAXID
        100101
    Session1>
    --> Yes, session 2 hangs until...
    Session1>BEGIN
      2   UPDATE taxids SET status=1 WHERE taxid=100101;
      3   COMMIT;
      4  END;
      5  /
    PL/SQL procedure successfully completed.
    Session1>
    --> and then
    Session2> select t.taxid
      2   from
      3    (select taxid, rowid rd
      4      from   taxids
      5      where  locationid = 111
      6      and    nvl(status,0) = 0
      7      order by taxid) x
      8   ,  taxids t
      9   where t.rowid = x.rd
    10   and   rownum = 1
    11   for update of t.status;
         TAXID
        100102
    Session2>Session 2 should never be allowed to get 100101 once the lock is released.
    This is a bug.
    The worrying thing is that I can reproduce in 9.2.0.8 and 11.2.0.2.

Maybe you are looking for

  • How should we delete payment advice?

    Hi everyone, Can anyone please clarify me the following question? I have created a remittance/payment advice in FBE1just 6 days back. Now, when i am trying to delete this advice system threws  message "Pmnt advice XXXXXXXXXXXXXX cannot yet be deleted

  • Color wheel keeps appearing

    Hi, In the last two weeks the color wheel started to appear when browsing, etc making the system very slow. I ran EtreCheck and below are the results.  I see a couple of fails but i don't know how to fix this. Any ideas? Thanks!! Problem description:

  • In Messages, I can't get it to let me log into iMessages.

    I can log into any of my app id account any where exept in messages on my mac book pro.

  • Payment engine failed to complete installation at startup

    Hi All, When first logging into SAP B1 8.8, the payment engine installation message came up but then it display error message "1628: Failed to complete installation". But when logging in as administrator on the server, the payment engine loaded ok. I

  • Execute via MS-DOS parameters

    Right-click command.com (MS-DOS) -> Properties -> Program What goes into these fields so that it will execute a jar file in the same folder? I tried "C:\My Documents\folder\java.exe" -jar program.jar But MS-DOS executes with " Specified COMMAND searc