Skip to content
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

DATAJPA-931 - Avoid unnecessary merging on save. #237

Closed
wants to merge 2 commits into from

Conversation

schauder
Copy link
Contributor

@schauder schauder commented Dec 8, 2017

Checking if entity is already attached to entity manager before calling merge.

Fixed one test that was relying on the implicit flush triggered by the save.

See also: https://vladmihalcea.com/2016/07/19/jpa-persist-and-merge/

Checking if entity is already attached to entity manager before calling merge.

Fixed one test that was relying on the implicit flush triggered by the save.

See also: https://vladmihalcea.com/2016/07/19/jpa-persist-and-merge/
@@ -89,7 +90,7 @@ public void auditsTransitiveEntitiesCorrectly() {
role.setName("ADMIN");

user.addRole(role);
repository.save(user);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change needed? And if applied, shouldn't it be saveAndFlush(…)?

@schauder
Copy link
Contributor Author

merged: 26f70bf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants