1) Start a tx
2) Check if node is empty
3) If so, write to node
4) End tx
Would it be appropriate to use the DummyTransactionManager here? I thought I had read somewhere that it wasn't recommended for production use... Thank you for your reply.
Also, I wrote a simple test case, and got some unexpected behaviour.
I started a tx in the first vm, then checked if a node 'existed'. Then, from another VM, I added data to that node. Back in the original VM, I added data to a node and called commit.
I was expecting some sort of rollback exception, but instead it overwrote the value that the 2nd VM had placed in the node.
To me, this appreas incorrect. Any ideas on something i'm doing wrong? Thanks again for the help.
1) Wouldn't recommend the dummy TM in production.
2) Did the 2nd node use a tx as well? If it didn't then there is no guarantee that it's data will be safe. If both nodes used txs, then the 2nd node would not have been able to commit (it would have rolled back)