You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by Reto Bachmann-Gmür <re...@apache.org> on 2013/10/25 09:33:43 UTC

Graph not closing

Hello,

I'm running into a problem closing a graph (I get from TDB).

According to:

http://jena.apache.org/documentation/javadoc/jena/com/hp/hpl/jena/graph/Graph.html#isClosed%28%29

idClosed should return true as soon as close is called. Howver for me it
doesn't return true even after waiting a while:

        jenaGraph.close();
        for (int i = 0; !jenaGraph.isClosed() && (i < 100); i++) {
            try {
                Thread.sleep(10);
            } catch (InterruptedException ex) {
                Thread.currentThread().interrupt();
            }
        }
        if (!jenaGraph.isClosed()) {
            throw new RuntimeException("hmmm");
        }

Any idea where the problem lies?

Cheers,
Reto

Re: Graph not closing

Posted by Andy Seaborne <an...@apache.org>.
On 25/10/13 08:33, Reto Bachmann-Gmür wrote:
> Hello,
>
> I'm running into a problem closing a graph (I get from TDB).
>
> According to:
>
> http://jena.apache.org/documentation/javadoc/jena/com/hp/hpl/jena/graph/Graph.html#isClosed%28%29
>
> idClosed should return true as soon as close is called. Howver for me it
> doesn't return true even after waiting a while:
>
>          jenaGraph.close();
>          for (int i = 0; !jenaGraph.isClosed() && (i < 100); i++) {
>              try {
>                  Thread.sleep(10);
>              } catch (InterruptedException ex) {
>                  Thread.currentThread().interrupt();
>              }
>          }
>          if (!jenaGraph.isClosed()) {
>              throw new RuntimeException("hmmm");
>          }
>
> Any idea where the problem lies?
>
> Cheers,
> Reto
>

Bug in GraphTDB - it's failing to pass the "close()" call up the 
inheritance chain.  Just fixed it (JENA-571).

((
Closing a TDB graph is a bit of a no-op because a GraphTDB is a 
stateless view of the dataset.  The only way in which it affects the 
dataset is that it may cause a sync() on the database.
))

	Andy