We are having a problem with the following code. moCurrentQuery.hasNext() is not returning false and continuing to loop the resultset indefinetly. Any help is appreiciated.
This is how we are doing in our code:
0. VWQueue.createQuery(null, null, null, VWQueue.QUERY_NO_OPTIONS, filter, subVar, VWFetchType.FETCH_TYPE_WORKOBJ ECT);
1. START OF LOOP
2. if(moCurrentQuery.hasNext()== false)
3. workItem = moCurrentQuery.next();
4. END OF LOOP.
For some reason, this loop is never ending when it starts first time in the day.
For example, if it grabs 100 items, it is looping 100 items again and again. Meaning the pointer of the filenet resultset is being reset to first row. It is never going into the step 2 above and finishing the loop.
NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
This topic has been locked.
2 replies Latest Post - 2009-02-23T21:00:22Z by SystemAdmin
Pinned topic moCurrentQuery.hasNext() is not returning false
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2009-02-23T21:00:22Z at 2009-02-23T21:00:22Z by SystemAdmin
Re: moCurrentQuery.hasNext() is not returning false2009-02-19T22:48:23Z in response to SystemAdminwhy dont you try the while loop (as shown below) instead of the the if condition within a loop. I dont know if that is the problem, but i used the hasNext() method with the while loop (as shown below) and it works fine for me...
vwQry = vwRoster.createQuery(null,null,null,1,sQueryStr,null,VWFetchType.FETCH_TYPE_WORKOBJECT);
vwElem = (VWWorkObject) vwQry.next();
// other code
Re: moCurrentQuery.hasNext() is not returning false2009-02-23T21:00:22Z in response to SystemAdminIt was part of our architecture, so and that code is everywhere in all our application. And it is working fine everywhere. For that matter, this code also works many times, but doesn't work sometimes.