fixed optimization issue that left result sets open in case of no entry in the result, issue
@@ -41,15 +41,19 @@ public class OLocalResultSetLifecycleDecorator implements OResultSet {
@Override
public boolean hasNext() {
- return entity.hasNext();
+ boolean hasNext = entity.hasNext();
+ if (!hasNext) {
+ close();
+ }
+ return hasNext;
}
@Override
public OResult next() {
- OResult result = entity.next();
if (!hasNext()) {
- close();
+ throw new IllegalStateException();
}
+ OResult result = entity.next();
return result;
}
