> The problem is that outside of the test it's strange to surface the Neo
> transactions outside of the persistence layer. This is not really a neo
> issue but since the difference is so large, I was wondering if there is a
> nice way to do this? I understand that we can't nest transactions.
>

Perhaps I misunderstood the question, but I believe you can nest
transactions, and the highest one rules. In essense, you code transactions
down in the core code on each write, but when you want to group a large
number of writes together to improve performance, just wrap that loop or
block or whatever, in another transaction. The inner transaction becomes a
placebo, and the outer one does the real work, improving performance.

A common pattern in web applications is to wrap all web requests in a single
transaction, so no matter what actual work is done in the controller or
model code, only one commit occurs, not many.

When I write database loaders, I usually commit and reopen transactions
based on a counter (so commit every 1000 lines of data, for example).
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to