3 Replies Latest reply: Mar 2, 2013 8:16 AM by AndyPol RSS

    APEX Error: Current version of data in database has changed since user init

    user11987733
      Hi:
      APEX 4.1
      I have a page with 2 regions. The first region is built with custom SQL using the APEX APIs. I have a process the can successfully update records.

      I built the second region with the tabular form wizard. This created the multi row update process.

      I created a region button and the two process respond to that button: process for first region, then process for the second region.

      When I add data to the second region and click the region button, I get the following error:

      Current version of data in database has changed since user initiated update process. current row version identifier = "A884FA378C851786DDFE3A33709CB23C" application row version identifier = "9ED06A0F09F80F054AB781CA24CC4CBF"

      I know it has something to do with these two types of regions being on the same page, because when I create a page of just the table form, the data is updated.

      Can anyone suggest what I might be doing wrong?

      Thanks.
        • 1. Re: APEX Error: Current version of data in database has changed since user init
          AndyPol
          Hello

          If you try update the same data from 2 places you will got this message because:

          Apex forms have locking mechanism.
          1. During fetch data to form apex calculate checksum from every items on the forms.
          2. Before update process apex again fetch data from database (in background) and calculate checksum again if checksum from point 1 is the same like this checksum APEX realy update data with new item values. If no, You will got your error (apex secure You, You realy don't know what you update).

          According this if you change data which you use in the form between 1 and 2 point you will got this "error". You can check it for example if you change data from SQL/Plus or from other form.

          Probably you forget about this locking mechanism during designe your process from APEX API <- successfully update records (maybe successful but you don't know what you updated) : )


          If I helped You please check correct or helpful :)
          • 2. Re: APEX Error: Current version of data in database has changed since user init
            user11987733
            Thank you for your reply.

            "If you try update the same data from 2 places you will got this message"

            I am fully aware of and familiar with Oracle's and APEX's locking strategies. My application is in development and I am the only person working on it and the underlying tables. So, there is no contention between me an another user.

            I know this error has do do with me having two regions on the page, because when I create just the tabular form on a separate page I do not get this error.

            Again, thanks for the reply. Anyone else?
            • 3. Re: APEX Error: Current version of data in database has changed since user init
              AndyPol
              Hello

              OK, you working only one but two regions try update the same data like two men. If you will set condition "Never" on the proces witch connected with first region probably you will update via second region without problem and vice verse.