Skip to content

Repository.saveAll does not cache over hole transaction #2882

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

Closed
shanon84 opened this issue Mar 18, 2024 · 1 comment
Closed

Repository.saveAll does not cache over hole transaction #2882

shanon84 opened this issue Mar 18, 2024 · 1 comment
Assignees
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@shanon84
Copy link

Hey,
Scenario: you have 10 new person nodes and want to save them with a relation to an existing adress.
If you use the PersonRepository.saveAll, the adress will be saved 10 times, even if it is the same node on every person.
In Neo4jTemplate.saveAllImpl after saving the persons, the relationships are processed. Here a new ProcessingStateMachine is created for each node. If you would reuse the same StateMachine, it would not write/process the same nodes again and again.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 18, 2024
@michael-simons
Copy link
Collaborator

What a nice, low hanging fruit. You are totally right, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

3 participants