[
https://issues.apache.org/jira/browse/TINKERPOP-789?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
stephen mallette closed TINKERPOP-789.
--------------------------------------
Resolution: Won't Do
I don't think there's a reason to burden providers with yet another batch of
tests. Closing a graph can have wide meaning and it is probably best to leave
it up to the graph to decide the best way to handle that. TinkerGraph's current
close operation generally makes sense, though multiple calls to {{close()}}
will repeatedly save a graph if a "save file location" is specified - a little
odd. In any case, {{AutoCloseable}} seems to be implemented in a variety of
ways in the java world so perhaps this behavior (or the fact that after
{{close()}} you can still call methods on the graph like {{addVertex}}) is not
so out of line. Consider {{ByteArrayInputStream.close()}} who's javadoc states:
"Closing a ByteArrayInputStream has no effect. The methods in this class can be
called after the stream has been closed without generating an IOException."
Anyway, I think I will just update the javadoc on {{TinkerGraph.close()}} and
close this out.
> Choose then Enforce Semantics for Graph.close()
> -----------------------------------------------
>
> Key: TINKERPOP-789
> URL: https://issues.apache.org/jira/browse/TINKERPOP-789
> Project: TinkerPop
> Issue Type: Improvement
> Components: structure, test-suite
> Affects Versions: 3.0.2-incubating
> Reporter: stephen mallette
> Assignee: stephen mallette
>
> The semantics for {{Graph.close()}} are fairly open right now. See
> TinkerGraph:
> {code}
> gremlin> graph = TinkerFactory.createModern()
> ==>tinkergraph[vertices:6 edges:6]
> gremlin> graph.close()
> ==>null
> gremlin> graph.vertices()
> ==>v[1]
> ==>v[2]
> ==>v[3]
> ==>v[4]
> ==>v[5]
> ==>v[6]
> {code}
> Seems like a call to {{close()}} should mean something especially since we
> implement {{AutoCloseable}}. I believe that most graphs throw exceptions
> (Titan does {{IllegalStateException}} i think) if you try to access the graph
> once {{close()}} is called.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)