On 24/08/12 18:53, Stephen Allen wrote:
Currently it is a). You MUST close the QueryExecution object.
Especially in the case that you are using QueryEngineHTTP (if you do
not close this, then it leaves a connection open to the remote
endpoint, and can end up exhausting the Fuseki thread pool over time).
It does not close automatically after you finish iterating the
ResultSet returned from execSelect() and possibly
execConstructTriples(). I feel like this is a bug. As a back-up for
the developer not closing the QueryExecution, the code should close it
when they've iterated through the entire ResultSet. Tracked in
JENA-305.
Agreed.
And on a related note, I wonder if execSelect or even deeper in
HttpQuery.exec should read the entire response, and not try to do
end-to-end streaming. That way, a slow/bad application can't affect the
remote server by holding connections open for too long. Obvious down
side is that things are resource limited
SERVICE already does this because it may loop back to the same server.
Andy