3 Replies Latest reply: Mar 5, 2013 12:24 AM by Abhijit Dutta RSS

    RowInconsistentException JBO-25014 when trying to remove rows

    994616
      Hi All,

      In my AMImpl.java, I have written this code to delete all the rows having same 'occurrenceId' value as the current row which triggers this method :

      public void deleteRecords() {

      AssignmentRowImpl currentRow = this.getAssignment().getCurrentRow();
      Long occurrenceId = (Long)currentRow.getAttribute("OccurrenceId");

      VOImpl assignVO = this.getAssignmentVO();
      ViewCriteria vc = assignVO.getViewCriteria("findByOccurrenceId");
      assignVO.setNamedWhereClauseParam('pOccurrenceId" , occurrenceId);
      assignVO.applyViewCriteria(vc);
      assignVO.executeQuery();

      RowSetIterator iter = assignVO.createRowSetInterator(null);

      while(iter.hasNext() ) {
      AssignmentRowImpl row = (AssignmentRowImpl)iter.next();
      row.remove();
      }

      iter.close();

      try {
      this.getTransaction.commit(); }
      catch(Exception e) {e.printStackTrace(); }

      }

      The issue is that 'commit' is throwing RowInconsistentException. I am sure that no other user is having a lock on records.

      I have tried the following without any success :

      1. Calling row.refresh(Row.REFRESH_UNDO_CHANGES) before row.remove
      2. Calling refresh(REFRESH_WITH_DB_FORGET_CHANGES) before row.remove
      3. Making 'Refresh After Insert/Update' = 'true' for History columns and Primary key attributes in the corresponding EO.

      None of the above helped and I keep getting RowInconsistentException JBO-25014
      Please help me resolve this issue.

      Thanks in advance,
      Abhinav
      abhinav.shukla@oracle.com