Monday, July 16, 2012

ADF tip: RowIterator

An ADF tip I can give you is the following: if you need a RowIterator multiple times, store it into an object. We've had an issue with getting it 2 times. Our application didn't give an error, would would appear to be busy forever, while not returning any results.

This was our case:
SomeVORowImpl someRow= (SomeVORowImpl)baseRow.getSomeVO().createRow();
//Do something with row
baseRow.getSomeVO().insertRow(someRow);
It would execute correctly (without errors), but the application would then hang. We've replaced the duplicate call to baseRow.getSomeVO() and stored it into a RowIterator object:
RowIterator someVO = baseRow.getSomeVO();
SomeVORowImpl someRow = (SomeVORowImpl)someVO.createRow();
//Do something with row
someVO.insertRow(someRow);
This did the trick. We haven't dug to the bottom of why this happened, but if we can reproduce this in a small test application, we might file a bug.