skymoney
skymoney

Reputation: 211

Neo4j can't get all nodes after reconnecting to the database

I used EmbeddedGraphDatabase() to create a neo4j database and create some nodes and relationships. Then I shut down the database. But after I reconnected the database,using following method: GraphDatabaseService graphDb=new EmbeddedGraphDatabase(DB_PATH);//DB_PATH is the path of original db

and then I tried to get all nodes using GlobalGraphOperations.at(graphDb).getAllNodes();

but I can't get all nodes, that means,I can't get nodes which were created when I first connect the database.

Dev Environment: Version of neo4j is 1.9M01 and the IDE is Eclipse while jdk is 1.6-win32

Anyone knows the reason?

Many thanks!!

Upvotes: 2

Views: 333

Answers (1)

user1833034
user1833034

Reputation: 21

I had the same issue, where i was not able to retrieve my nodes based on their index. I was missing the tx.success() when i created my database. When i recreated the DB and included tx.success() in the finally{} clause, everything started working as a magic!! Thanks a lot cporte!!

Salini

Upvotes: 2

Related Questions