Transactions in Neo4j use a read-committed isolation level, which means they will see data as soon as it has been committed and will not see data in other transactions that have not yet been committed. This type of isolation is weaker than serialization but offers significant performance advantages whilst being sufficient for the overwhelming majority of cases.

In addition, the Neo4j Java API enables explicit locking of nodes and relationships. Using locks gives the opportunity to simulate the effects of higher levels of isolation by obtaining and releasing locks explicitly. For example, if a write lock is taken on a common node or relationship, then all transactions will serialize on that lock — giving the effect of a serialization isolation level.

During transaction commit, all the transactional operations applied to a store in certain order. At the moment order of operations is:

  1. Label tokens operations
  2. Relationship type tokens operations
  3. Property key token operations
  4. Create Operations for:
    1. Properties
    2. Relationships
    3. Relationship groups
    4. Nodes
  5. Update Operations for:
    1. Properties
    2. Relationships
    3. Relationship groups
    4. Nodes
  6. Delete Operations for:
    1. Properties
    2. Relationships
    3. Relationship groups
    4. Nodes
  7. Neo Store commands
  8. Schema commands
  9. Count store operations
  10. Index operations
  11. Legacy index operations

Please note we cannot guarantee that this order will remain the same in future versions of Neo4j. If it does change for some reason, we will update this article accordingly.

Details


Author:
José Rocha
Applicable versions:
3.5
Keywords:
commitneo4j-3.5transaction