I’m mixing spring-data and CXF to create a RESTful endpoint that creates neo4j nodes. My structure is a set Interfaces which define the public facing methods, and my implementations which have several private methods under that are called by my public methods.
My private methods have spring-tx’s @Transactional on them, and when I try to call these from my public methods, I get a org.neo4j.graphdb.NotInTransactionException. Below is a GitHub project that is setup to show my configuration and you can also run it to see what’s wrong:
https://github.com/NicholasAStuart/broken-spring-neo4j-cxf.git
Can anyone help me? I’ve followed the steps from the documentation on spring-data-neo4j, but I cannot seem to get this working, can anyone help me?
The
@Transactionalannotation does not work on private methods.From the Spring documentation:
You may be able to use the
aspectjmode to enable this behavior on any type of method.