Found this while reading the Neo4j manual, specifically here, I found the sentence:
“All mutating transactions have to be performed in a transaction.”
Clearly a mutating transaction isn’t just a type of transaction of the latter sort. Could someone help clarify the relationship between each of these things and the database?
It should say all mutating operations should be performed inside a transaction. A mutating operation is stuff like creating or updating a node/relationship, or adding stuff to an index.
If you are using the Java API directly (i.e. not the REST API), then you must wrap each create or update method in a transaction.
Here’s an example of creating and indexing a node, wrapped in a transaction:
https://github.com/espeed/bulbs/blob/master/bulbs/neo4jserver/gremlin.groovy#L11
Note that the code above is the Neo4j Java API, but it’s being used in a Groovy script.
You can execute Groovy scripts via the Neo4j Server Gremlin-Groovy Plugin. This means you have access to the entire Neo4j Java API via REST.