[Blueprints] Consistency after shutdown()

34 views
Skip to first unread message

Pierre De Wilde

unread,
Jul 31, 2011, 1:47:35 AM7/31/11
to gremli...@googlegroups.com
Hi,

After shutdown(), data should not be accessible. 
This is not consistent across Blueprints implementations:

Neo4jGraph(): OK
gremlin> g = new Neo4jGraph('../data/neo4j/tinkergraph')
==>neo4jgraph[EmbeddedGraphDatabase [../data/neo4j/tinkergraph]]
gremlin> g.shutdown()                                   
==>null
gremlin> g.V                                            
gremlin>

OrientGraph(): data still available
gremlin> g = new OrientGraph('local:../data/orient/tinkergraph')
==>orientgraph[local:../data/orient/tinkergraph]
gremlin> g.shutdown()                                           
==>null
gremlin> g.V                                                    
==>v[#5:0]
==>v[#5:1]
==>v[#5:2]
==>v[#5:3]
==>v[#5:4]
==>v[#5:5]

TinkerGraph(): data still available
gremlin> g = new TinkerGraph('../data/tg/tinkergraph')
==>tinkergraph[vertices:6 edges:6]
gremlin> g.shutdown()
==>null
gremlin> g.V
==>v[3]
==>v[2]
==>v[1]
==>v[6]
==>v[5]
==>v[4]

DexGraph(): crash
gremlin> g = new DexGraph('../data/dex/tinkergraph')      
==>dexgraph[../data/dex/tinkergraph]
gremlin> g.shutdown()                                     
==>null
gremlin> g.V                                              
Invalid memory access of location 0x10 rip=0x10e0ad7dc
target/gremlin-1.2-SNAPSHOT-standalone/bin/gremlin.sh: line 36: 28413 Segmentation fault: 11  $JAVA $JAVA_OPTIONS -cp $CP com.tinkerpop.gremlin.console.Console

MemoryStoreSailGraph(): error message
gremlin> g = new MemoryStoreSailGraph()
==>sailgraph[memorystore]
gremlin> g.loadRDF(new FileInputStream('data/graph-example-1.ntriple'), 'http://tinkerpop.com#', 'n-triples', null)
==>null
gremlin> g.shutdown()
==>null
gremlin> g.E         
Connection has been closed

NativeStoreSailGraph(): error message
gremlin> g = new NativeStoreSailGraph('../data/sail/tinkergraph')
==>sailgraph[nativestore]
gremlin> g.loadRDF(new FileInputStream('data/graph-example-1.ntriple'), 'http://tinkerpop.com#', 'n-triples', null)
==>null
gremlin> g.shutdown()                                                                                              
==>null
gremlin> g.E
Connection has been closed

Thanks,
Pierre

Joshua Shinavier

unread,
Jul 31, 2011, 3:04:02 AM7/31/11
to gremli...@googlegroups.com
Hi Pierre,

Thanks for investigating. Personally, I think throwing a (single type
of) exception in all impls would make the most sense.

Josh

Pierre De Wilde

unread,
Jul 31, 2011, 3:10:27 AM7/31/11
to gremli...@googlegroups.com
+1

You're a lucky guy since it's already implemented that way in *SailGraph()...

Pierre

Joshua Shinavier

unread,
Jul 31, 2011, 3:35:04 AM7/31/11
to gremli...@googlegroups.com
On Sun, Jul 31, 2011 at 3:10 PM, Pierre De Wilde
<pierre...@gmail.com> wrote:
> +1
>
> You're a lucky guy since it's already implemented that way in
> *SailGraph()...


Well, an exception is thrown there. Not necessarily the right
exception, though.

Josh

Luca Garulli

unread,
Jul 31, 2011, 6:52:49 AM7/31/11
to gremli...@googlegroups.com
+1,
I've changed OrientDB to throw a IllegalStateException("Database is closed") if the graph instance is reused after a shutdown.

Reply all
Reply to author
Forward
0 new messages