-
Notifications
You must be signed in to change notification settings - Fork 617
Relationship statemachine uses internal ids all the time, not being able to keep track of processed values. #2500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Sorry, but I can't investigate this issue with just a snippet of JSON code. The other issue had been solved. |
Ok I edited the initial post. |
Can you possibly try out the latest snapshot? Actually, there has been work in this area and I'm pretty sure this will affect your usecase: |
I've tried compiling main branch and referencing it from my project. The error is 400 Bad request with response:
and error log:
if I try to add the relationship objects. |
Please create a reproducer and share it (Something that is executable as is). |
Here's ready to be attached to a neo4j instance and tried out, https://github.com/paolodedo/service |
Hey. So the class cast issue is due to a dependency problem with Spring Boot. They didn't upgrade the Neo4j Java driver. Sorry for that issue. If you set
with the snapshots, it works. Your original problem still persist respectively I am investigating. |
Ok, thank you very much. Thank and see you soon. |
…ionship statemachine. When checking if a relationship has already been processed, the actual fromId is always the one returned by the persistent entity: This is always an internal generated id when no id generators are present, but when a user runs their own, it’s not. Therefor, when the internal id is always used in the statemachine, a processed relationship would have not been seen and known and deleted in a 2nd go. This fixes #2500.
…ionship statemachine. When checking if a relationship has already been processed, the actual fromId is always the one returned by the persistent entity: This is always an internal generated id when no id generators are present, but when a user runs their own, it’s not. Therefor, when the internal id is always used in the statemachine, a processed relationship would have not been seen and known and deleted in a 2nd go. This fixes #2500.
Thanks, @paolodedo for the reproducer and the effort put into nudging us :) This is fixed and will be out on monday. In the meantime, I have sent you a PR. |
…ionship statemachine. When checking if a relationship has already been processed, the actual fromId is always the one returned by the persistent entity: This is always an internal generated id when no id generators are present, but when a user runs their own, it’s not. Therefor, when the internal id is always used in the statemachine, a processed relationship would have not been seen and known and deleted in a 2nd go. This fixes #2500.
Thank you very much for your time and effort :) Your PR is fixing POST and PATCH scenarios: relationship are created without the need of setting them bidirectionally. But, for PUT requests scenario, relationships are not changed. |
No, I don't know… For reference, here the compare it with the same data sent
|
A put on the sub resource does work as expected
don't know much more about Spring Data Rest… Maybe @odrotbohm knows more what's going on. |
Thanks for being so accurate. For the moment, I'll use PATCH, and try to indagate the Spring Data Rest PUT issue. |
You're welcome, @paolodedo I read through the linked issue in Spring Data Rest: I think that Spring Data Rest should load the entity in question first and than update the fields through the PUT request, so that the associations are populated. That would be in line with what Oliver writes here spring-projects/spring-data-rest#1364 (comment) |
Regarding issue
#2282
that was about the need of adding relationship-objects to both the Sets of objects in order to save a relationship,
🔵with the dependencies:
spring-boot-starter-data-neo4j:2.6.4
spring-data-neo4j:6.2.2
🔵with the models:
🔵with the controller for Group (empty because rest services are auto-generated):
the following POST request on the GroupController ReST endpoint returns a 200 OK (I expect the relationship with devices has been created):
but no relationship is created (not treated as a relationship for SDN as you'd have to tell your body that even the Device entity is linking to this very Group object); unfortunately, due to the double-side relationship saving mechanism, Spring Data Rest automatically generated ReST services (HATEOAS) have the relationship creation feature broken:
Do you have a solution for that?
Thanks!
The text was updated successfully, but these errors were encountered: