0
votes

I am developing a adf web application using jdeveloper 11.1.2.4. I have a search form as below.

enter image description here

Actually when I first visit this page I am getting an empty form. After performing some search operations I visited another page, and then again when I come back to this page, the page retains the previous search results. At this point of time when I am trying to modify anthing means updating or deleting I am getting the follwoing excepiton.

Another user has changed the row with primary key oracle.jbo.Key[1 ].

The modifications has successfully done when I accessed this page for the first time. I tried with clearing viewobject and entityobject cache. But no luck.

I think if I get a fresh page everytime when I visit this page this problem could be resolved. Or if there is any other better solution please let me know .

Please help me to remove this exception. Please suggest me with a solution.

Thanks in advance.

4
Re-executing the VO should resolve your issue - User404
I have a bounded task flow. In that I place a method before goint to the above page. In that method I have pasted the following code. But it is not working. Tried to re-execute the view object - Abdul
BindingContext b = BindingContext.getCurrent(); DCDataControl d = b.findDataControl("AppModuleDataControl"); d.getApplicationModule().findViewObject("KpiView1").executeQuery(); - Abdul

4 Answers

1
votes

We usually suppress this exception on complex ADF systems by overriding lock() method in all our Entity Impl classes:

  /**
     * customizing locking management:
     * Because attribute  values  can change 'outside' ADF standard life cycle,
     * when optimistic locking executes, the exception "Another User Changed the Row" is thrown.
     * In this case, we execute locking again, ignoring the exception
     */
    public void lock() {
        try {
            super.lock();
        } catch (oracle.jbo.RowInconsistentException e) {
            if (e.getErrorCode().equals("25014")) {
                super.lock();
            } else
                throw e;
        }
    }
0
votes

Which locking system are you currently using?

You will have to acquire the lock on that record in order to get rid of such exceptions.

look into this thread for one way to acquire a lock. https://community.oracle.com/thread/2401637

or you can also acquire a lock at anytime by calling EntityImpl.lock() method on the corresponding EO instance, even if the locking mode is optimistic.

0
votes

Hey you can try the following things. It worked for me

  • Change primary key settings on EO to Refresh After --> Update/Insert.
  • Change the "Change Indicator" option on object version number attribute on EO.
  • added vo.clearCache(); before commit
  • Redeploy UiModel.
0
votes

Setting "Changed Indicator" option to true in the Entity Object for the specify primary key attribute solved my issue.