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


Try these solutions:
  1.  make sure that you check "refresh after insert" and refresh after update" for the primary key column in you entity object.
  2. in the application module tab Click the Properties tab and select jbo.locking.mode. Double click the “pessimistic”value next to the property to open the field editor and type “optimistic” over the value.Press enter.
  3. if error still exist then you must set "refresh after insert" and refresh after update" as true for all attributes in the entity object
  4. another way is to execute the View Object after the commit operation to bring back updated data to ViewObject. For this we need to override the afterCommit() of ViewObject class as follows:
                 public void afterCommit(TransactionEvent){
                        executeQuery();
                      }
   
         5- another way to solve this error is to overide the lock() method of the EntityImpl class
 
    public void lock() {
        try {
        super.lock();
        } catch (RowInconsistentException e) {
        refresh(REFRESH_WITH_DB_ONLY_IF_UNCHANGED | REFRESH_CONTAINEES) ;
        
        super.lock();
        }

    }

Comments

Anonymous said…
WOW.... THIS ACTUALLY WORKS....
I faced the same problem. So i followed the steps that you have given.
1. I checked the refresh after insert and update. It dint work so I proceeded with the 2nd point
2. In application module I already have the settings of locking mode as optimistic. So this also dint help me.
3.I checked the refresh after insert/update in all the attributes in the entity object. But still the same error is being thrown.

I am unable to solve it!! Is there anything else that I need to check ?
Tarek Fathy said…
do you have a database trigger that internally populates the value of any of your attributes. For example , if you have "CreatedBy" column that is populated by a database trigger, you must set this attribute "refresh on insert" to true.
Anil said…
I am facing the same issue . I have a ClobDomain attribute in my entity object. it works fine while creating a row but update doesn't work for the same row. is there a different way to update a row with ClobDomain column ?

Any help/pointer is highly appreciated.

Popular posts from this blog

Working With File Throgh WebUtill

Reading From File