Update of a relationship fails without error


I need some help with some puzzling behavior of Spring/OGM/Neo4j.

I have a node entity (Movie) with an outgoing relationship to another node entity (Actor).
Creating a new movie with a new actor works just fine.

However, when I take an existing movie, change the actor to a new node entity and save the adjusted movie the relationship is not changed and the new actor node is not saved. Basically any relationship properties of existing nodes are not updated at all!

I've created a small example repository with a failing integration test:

In there I do the following:

  1. Create a movie
  2. Create an actor (actor1)
  3. Set movie -> actor1
  4. Save the movie
  5. Create another actor (actor2)
  6. Set movie -> actor2
  7. Save the adjusted movie
  8. Request the movie, expect the actor to be actor2 (which fails)

Any idea?

Got it myself – missing @Transactional at the method.

1 Like