Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

RowSetIterator next() never returns null, causing infinite loop

user8400258Jan 8 2015 — edited Jan 9 2015

I'm using JDeveloper 11.1.1.6.

One tricky issue we found is looping through a view object using RowSetIterator.

  • next() of RowSetIterator never return null, it resets to first at the end
  • This is for a certain view object only (we have another VO in the same page doing the same thing but works fine)

Below is the code:

DCBindingContainer bc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();

EmpVOImpl empVoImpl=(EmpVOImpl)bc.findIteratorBinding("EmpVO1Iterator").getViewObject();

   

RowSetIterator it = empVoImpl.getRowSetIterator();

EmpVORowImpl row = (EmpVORowImpl)it.first();

while(row != null){

   

    if(row.getSal()!=null){

        totalAmount=row.getSal().add(totalAmount);

    }

     row = it.next();

}

it.closeRowSetIterator();

My question is

  • is this a bug? if is, already fixed in later version?
  • what's the best practice for looping through a view object.

Thanks

Comments

Geert01
Answer
Marked as Answer by McRivers · Jan 13 2022
McRivers

YES! Thank you so much. I wish the article went in to more detail of what was happening and why this fixes it. Would love to learn more. Regardless, I appreciate you sharing this with me to help me out.

1 - 2
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Feb 6 2015
Added on Jan 8 2015
9 comments
781 views