Provide support to increase developer productivity in Java when using Neo4j. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
After rereading the neo4j transaction wiki page I'm pondering the idea to drop the current code for transaction participation ind spring-data-graph.
Current approach is: when I'm in a transaction just write the property back to the graph (or modify the relationship or create the node).
When I'm outside of a transaction just store the value in the java object. Whenever I'm back in a transaction write back all modified values in one go.
I could change that and replace that the way that all modifying operations would be wrapped in a neo4j transaction. That would ensure that they succeed regardless an outer transaction.
How is the penalty for creating a nested transaction on each property write?
A: Quite cheap, since a nested transaction isn't a nested transaction... it just returns a fake Transaction instance, no extra overhead.
And there is one scenario where this does not fit: Frameworks and people create throwaway entities all the time (e.g. in the web layer). If I wrap node creation in a transaction it would always create a node even for those
entities that are never intended to be stored. The current approach just doesn't flush those entities because they never get near a transaction. A solution for that could be, that node creation is never automatically wrapped in
a transaction just modifications of entities that are backed by existing nodes.
Michael Hunger opened DATAGRAPH-38 and commented
After rereading the neo4j transaction wiki page I'm pondering the idea to drop the current code for transaction participation ind spring-data-graph.
Current approach is: when I'm in a transaction just write the property back to the graph (or modify the relationship or create the node). When I'm outside of a transaction just store the value in the java object. Whenever I'm back in a transaction write back all modified values in one go.
I could change that and replace that the way that all modifying operations would be wrapped in a neo4j transaction. That would ensure that they succeed regardless an outer transaction.
How is the penalty for creating a nested transaction on each property write? A: Quite cheap, since a nested transaction isn't a nested transaction... it just returns a fake Transaction instance, no extra overhead.
And there is one scenario where this does not fit: Frameworks and people create throwaway entities all the time (e.g. in the web layer). If I wrap node creation in a transaction it would always create a node even for those entities that are never intended to be stored. The current approach just doesn't flush those entities because they never get near a transaction. A solution for that could be, that node creation is never automatically wrapped in a transaction just modifications of entities that are backed by existing nodes.
Affects: 1.0 M3
This issue is a sub-task of DATAGRAPH-45