i want to store some data in my neo4j database. i use spring-data-neo4j for that.
my code is like the follow:
for (int i = 0; i < newRisks.siz
I think I've found a solution:
I tried the same insert using the nativ neo4j java API:
GraphDatabaseService graphDb;
Node firstNode;
Node secondNode;
Relationship relationship;
graphDb = new EmbeddedGraphDatabase(DB_PATH);
Transaction tx = graphDb.beginTx();
try {
firstNode = graphDb.createNode();
firstNode.setProperty( "name", "Root" );
for (int i = 0; i < 60000; i++) {
secondNode = graphDb.createNode();
secondNode.setProperty( "name", "risk " + (i+1));
relationship = firstNode.createRelationshipTo( secondNode, RelTypes.CHILD );
}
tx.success();
}
finally {
tx.finish();
graphDb.shutdown();
}
the result: after some sconds, the database is filled with risks.
Maybe the reflections slow down this routine with spring-data-neo4j. @Michael Hunger says somthing like that in his book GoodRelationships, thanks for that tip.