You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/11/08 11:33:59 UTC
[jira] [Commented] (JENA-1215) Make ResultSets closeable
[ https://issues.apache.org/jira/browse/JENA-1215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15647299#comment-15647299 ]
ASF GitHub Bot commented on JENA-1215:
--------------------------------------
GitHub user afs opened a pull request:
https://github.com/apache/jena/pull/190
JENA-1215: Provide ResultSetCloseable.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/afs/jena closeable-result-set
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/jena/pull/190.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #190
----
commit 7605abd8343b6480cd5c699d87b3cbc3220833bf
Author: Andy Seaborne <an...@apache.org>
Date: 2016-11-08T11:32:09Z
JENA-1215: Provide ResultSetCloseable.
----
> Make ResultSets closeable
> -------------------------
>
> Key: JENA-1215
> URL: https://issues.apache.org/jira/browse/JENA-1215
> Project: Apache Jena
> Issue Type: Improvement
> Components: ARQ
> Affects Versions: Jena 3.1.1
> Environment: any
> Reporter: Paul Houle
>
> Currently the QueryExecution has to be closed after you are done working with a ResultSet. This means that you can't write a function that returns a ResultSet and expect the QueryExecution to be properly closed.
> This problem can be fixed like so.
> (1) Make the ResultSet interface extend ClosableIterator and probably AutoCloseable (and fall back to just adding close() in case plan A causes something awful to happen)
> (2) Put a reference to the QueryExecution (probably just a reference to any Autoclosable) into the StreamResultSet
> (3) Have the StreamResultSet close() implementations delegate to that, or otherwise do nothing
> (4) Have the ResultSetStream close itself when it gets to the end.
> (5) Make sure close on the relevant QueryExecution element is idempotent (doesn't crash on a double close) otherwise behavior (4) followed by a later QE.close() could cause trouble
> (6) Make close() a no-op on ResultSetMem(), there is no point in punishing users for using it or not using it.
> (7) ResultSetMem does not autoclose, put it in the javadocs that a ResultSetRewindable does not self-close, but a ResultSet which is not Rewindable does close when it hits the end
> (8) Think about what exactly to do for a ResultSetPeekable which is not Rewindable so we don't get blindsided by a corner condition.
> (9) No isClosed() method on ResultSet because it would call attention to any fuzziness involved in (6)
> I volunteer to do this.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)