setForwardOnly(true) does not iterate correctly through rowset
I am encountering a problem using setForwardOnly(true) with my View Objects. When I change my VO's to setForwardOnly(true), calling next() on them does not iterate to the next row.
For instance, I try this code (just an example):
void someMethodInViewObjectImpl ()
{
setForwardOnly(true);
setFetchMode(FETCH_ALL);
executeQuery ();
Row tempRow;
tempRow = next ();
for (int i=0; i<getRowCount(); i++)
{
for (int j=0; j<tempRow.getAttributeCount(); j++)
{
if (tempRow.getAttribute(j) != null)
System.out.print(tempRow.getAttribute(j).toString() + " ");
}
System.out.print ("\r\n");
tempRow = next();
}
}
The first call to next() returns the last row of the rowset, as does each subsequent call to next()
If I change the fetch mode to FETCH_AS_NEEDED, then the first call to next() returns the first row of the rowset, and each subsequent call returns the last row.
If I change setForwardOnly(false), the iteration works correctly.
Is there something I am missing about using setForwardOnly(true), or is there a bug with using it?
I am using 9.0.2.
Thank you for any assistance.