On Sat, Jan 4, 2014 at 4:56 AM, Rob Vesse <[email protected]> wrote:
> You are closing the result set indirectly (by closing the QueryExecution) 
> before you iterate it.
>
> Result set objects in ARQ are almost always streaming and the associated 
> QueryExecution should not be closed until you've finished iterating over the 
> results.
>
> Rob

And of course, since you may want to close any streaming resources
sooner rather than later, what counts as "finished iterating over the
results" doesn't necessarily mean "have done all the processing that
you need with the results."  You might want to use
ResultSetFactory.copyResults(ResultSet) [1]:

[[[
public static ResultSetRewindable copyResults(ResultSet results)

Take a copy of a result set - the result set returns is an in-memory
copy. It is not attached to the original query execution object which
can be closed.
]]]

//JT

[1] 
http://jena.apache.org/documentation/javadoc/arq/com/hp/hpl/jena/query/ResultSetFactory.html#copyResults(com.hp.hpl.jena.query.ResultSet)


-- 
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/

Reply via email to