[Neo4j] Multiple sessions

2011-07-01 Thread Vaccaro, Kristen M
Hi, I have a question about sessions in Neo4j. I'm working with the embedded 
Java (not as a server) and I can load my data and query it between transactions 
without trouble. My question is whether/how it's possible to shut down my 
database at the end of a session and then access it in a new session later.

Something like first doing:
GraphDatabaseService graphDb = new EmbeddedGraphDatabase( var/test/base );
...Add all my data using transactions

Then later opening a new session and accessing that database and indices I've 
already made. Is that possible (I didn't see anything covering that in the 
wiki/documentation)? Or will I need to convert to the server version?

Neo4j mailing list

[Neo4j] Basic Ruby/Neo4j question

2011-05-11 Thread Vaccaro, Kristen M
Hi, I just started using Neo4j and I've got a pretty basic question. I've been 
running the gem using JRuby but I'm having trouble calling on edges/nodes I've 
made in previous transactions. So one of the very basic example scripts I've 
been working with looks like:

require rubygems
require 'neo4j'
Neo4j::Transaction.run do
a = Neo4j::Node.new :name = 'A'
b = Neo4j::Node.new :name = 'B'
c = Neo4j::Node.new :name = 'C'
d = Neo4j::Node.new :name = 'D'
e = Neo4j::Node.new :name = 'E'
a.outgoing(:friends)  b  c
b.outgoing(:friends)  d  e
c.outgoing(:friends)  b

If I call on any of those within the same transaction, things work great, but 
if I run that and then open a new transaction to query it, say:

Neo4j::Transaction.run do
a.outgoing(:friends).depth(2).each {|node| puts node[:name]}

I get undefined local variable errors for a. I thought that maybe I was missing 
a step where the database committed, but when I tried to switch over to the 
Transaction.new ... Transaction.finish formulation, I started getting 
undefined method errors for 'finish'... I assume I'm missing some basic step, 
but didn't see an answer in the examples/documentation, so I'd appreciate any 
Neo4j mailing list