Wednesday, January 6, 2016

Solution to JBO-25014: Another user has changed the row with primary key oracle.jbo.Key[xxx].

I have posted this issue here

Simultaneous Commit operation in ADF throws "oracle.jbo.RowInconsistentException: JBO-25014"

Chris has discussed this issue in detail here

I have how tackled the solution and such implementation can be applied as turn around solution.

The real culprit is:

We know the record in the mid-tier has been changed by the user, however ADF doesn't use the changed record in the mid-tier to compare to the database record, but rather a copy of the original record before it was changed.  This leaves us to conclude the database record has changed, but how and by who?

So,  simple call execute operation for that viewObject after commit would solve the problem .
as:            
   OperationBinding op = getBindings().getOperationBinding("searchApplication");  //searchApplication is the method which populates the VO
    op.execute();

But would reset the iterator and even though the selected row in table is (says 5th from the top), the form would be always displaying 1st row.

So i deal with problem with variable defined as:
private String currentRowKeyStr="";
i would set this variable to
currentRowKeyStr=row.getAttribute("PrimaryKeyValue")!=null?row.getAttribute("PrimaryKeyValue").toString():"";

Similarly,
on the table selection listener
selectionListener="#{pageFlowScope.Bean.selectTable_SelectionListener}"

i would set this variable every time a row is selected as:
currentRowKeyStr=rowSelected.getAttribute("PrimaryKeyValue")!=null?rowSelected.getAttribute("PrimaryKeyValue").toString():"";

Please post comment in case you need help with such issue

No comments:

Post a Comment