*method in AMImpl to delete the rows from view object
public String removeRows(BigDecimal bindId){
DCInspExampleVOImpl exVO=(DCInspExampleVOImpl) this.getDCInspExampleVO();
DCInspExampleDetailsVOImpl ex etVO=(DCInspExampleDetailsVOImpl) this.getDCInspExampleDetailsVO();
exVO.setBindId(bindId);
exVO.executeQuery();
while(exVO.hasNext()){
DCInspExampleVORowImpl exRow=(DCInspExampleVORowImpl) exVO.next();
exDetVO.setBindEnfId(exRow.getInspectionExampleId());
exDetVO.executeQuery();
RowSetIterator row = exDetVO.createRowSetIterator(null);
while(row.hasNext()){
row.next();
row.removeCurrentRow();
}
exVO.removeCurrentRow();
}
exVO.closeRowSetIterator();
row.closeRowSetIterator();
this.getDCInspExampleVO().getDBTransaction().commit();
this.getDCInspExampleDetailsVO().getDBTransaction().commit();
return null;
}
2 comments:
Be sure to close any RowSetIterators you create.
Sure.
Post a Comment