Closed coreation closed 8 years ago
Transactions are unique to Neo4j's REST Cypher endpoint. Nodes and relationships are created using the dedicated node and relationship endpoints. To have node creation also wrapped in transactions would mean rewriting the communication layer with Neo4j to use only Cypher, and not use dedicated endpoints.
If you need transactional semantics for bulk creation, you can use Cypher queries to handle that, and those queries can be wrapped in transactions.
Thanks for the answer!
First of all, great job on this library, really enjoy working with. Second, I see that transactions are part of the library, I was wondering if it worked without using the Query, but with creating nodes through the Client object.
So e.g.
// Begin transactions some transaction init code // Create nodes $node1 = $client->makeNode() $node1->save();
// Add some labels ....
// If all went well commit all of the above $transaction->commit();
Is something like this possible? My real question is how I can create multiple nodes and relationships, but break off the entire chain of that creation when something goes wrong. Transactions seem the easiest way to do this.