0
votes

I am having a problem with my Java program using a GraphDatabaseService. At start, I was using different paths for http://localhost:7744/webadmin and my Java program.

Then, I fixed it, using this question here: Neo4j - read and save data. So, this is not the problem!

Then, I open my DB, put some nodes on it. I searched with a query, and it just returned the nodes I created. Then I shutdown my DB. But everytime I rerun the program again, the nodes I created before are not there anymore! Then I go to webadmin, the nodes aren't there, too! So I decided to first create the nodes on webadmin console, and query them on console, it worked! After this, I tried to run a query on my Java program to look for these console nodes, and it worked, they were shown.

Then again, on the Java program, I run a query, create some new nodes, then run a query again. The first query returns the console nodes, the second returns the console nodes + the new ones created on the Java program.

But I just have again the same problem. On a new Java program run, it doesn't show the new nodes (the Java program ones), and neither on webadmin console.

Long story short, seems like my program is not saving the data (I might be wrong). You guys know any way to fix it?

1
I just solved, just need 8 hours before posting the answer! :) - Gabriel Calixto
Can you share the code where you read and write to the db? Are you committing your transactions? - jjaderberg
Ok, glad it worked out - jjaderberg

1 Answers

0
votes

I solved this!

Seems like I wasn't doing a tx.finish() in my Transaction tx, because I was using Eclipse, and it showed a warning saying that this method (tx.finish()) was deprecated, so I decided to remove it. Then I put it back again, ignoring the warning, and it solved my problem!

Just posting the answer here so I could help it if someone has the same problem.