History | Log In     View a printable version of the current page. Get help!  
Issue Details [XML]

Key: SES-718
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Arjohn Kampman
Reporter: James Leigh
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Sesame

NoSuchElementException thrown from hasNext

Created: 23/Jul/10 04:49 AM   Updated: 23/Jul/10 04:49 AM
Component/s: Query Engine
Affects Version/s: 2.3.2
Fix Version/s: None


 Description   
If an iterator hasNext() is called from thread A, then thread B closes the iteration, thread A might throw an NoSuchElementException when next() is called.

This is related to issue 714 - ORDER BY in query can block query interruption.

Some of OrderIterator's createIteration method is shown below for convenience. The state of iter might change after its hasNext() method is called, but before it's next() method is. This will cause the calling method, DelayedIteration.hasNext(), to propagate the NoSuchElementException.

Instead, loops like this should check for both hasNext() results *and* NoSuchElementException and treat them then same way, in this case, end the loop and return without and exception.

protected Iteration<BindingSet, QueryEvaluationException> createIteration()
throws QueryEvaluationException
{
TreeMap<BindingSet, Collection<BindingSet>> map;
map = new TreeMap<BindingSet, Collection<BindingSet>>(comparator);

int size = 0;

try {
while (iter.hasNext()) {
BindingSet next = iter.next();

 All   Comments   Change History      Sort Order:
There are no comments yet on this issue.