spring-projects / spring-projects/spring-data-rest

Unable to delete relationships in NEO4j using PUT/PATCH?DELETE [DATAREST-1301]

Open
#1,661 1 comment 0 reactions 1 assignee View on GitHub

@odrotbohm is already working on this.

Since Dec 31, 2020.

type: bug
Dominant language
Java
Stars
958
Forks
568
PR merge metrics
No merged PRs in 30d

Description

Fuzail Sarang opened DATAREST-1301 and commented

Using Spring Boot 2.1.0 with the Spring Boot Starter for Neo4j and Spring Data Rest with Spring Transactions.

Attached files to reproduce.

Scenario is the following

  • Create Parent
curl -i -X POST -H "Content-Type:application/json" -d '{}' http://localhost:8080/parent

 

  • Create Child
curl -i -X POST -H "Content-Type:application/json" -d '{}' http://localhost:8080/child
  • Create association
curl -i -X PUT -H "Content-Type:application/json" -d "http://localhost:8080/parent/<id>" -H "Content-Type:text/uri-list"  http://localhost:8080/child/<id>/parent
  • Attempt to delete association
curl -i -X DELETE  http://localhost:8080/child/1743/parent

Above will not delete the association as the Spring transaction is not started, instead it will use multiple Neo4J Transactions that will result in the relationship not being deleted. I have also attached a test which highlights the issues without the need for the rest calls. This has the same issue when updating using PUT/PATCH to remove associations.

 

 


Affects: 3.1.2 (Lovelace SR2)

Reference URL: https://stackoverflow.com/questions/25717127/handle-spring-data-rest-application-events-within-the-transaction

Attachments:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.