Search code examples
springneo4jcypherspring-data-neo4j

Readonly transactions with Neo4j


Are there any benefits of using Spring @Transactional(readOnly = true) with Neo4j/Neo4j Spring Data ? Should I mark readonly transactions as @Transactional(readOnly = true) or not ?


Solution

  • Since SDN 4.2 (4.2.RC1 at the time of writing) you can use read only transactions.

    As of SDN 4.2 you can also define read only transactions.

    You can start a read only transaction by marking a class or method with @Transactional(readOnly=true).

    http://docs.spring.io/spring-data/data-neo4j/docs/4.2.x/reference/html/#_read_only_transactions