Detach entities loaded by loadSingleton() (#1184)

* Detach entities loaded by loadSingleton()

* Reformatted
This commit is contained in:
Michael Muller
2021-06-01 14:22:57 -04:00
committed by GitHub
parent 810adf0158
commit 92f5f8989b
2 changed files with 14 additions and 1 deletions
@@ -504,7 +504,7 @@ public class JpaTransactionManagerImpl implements JpaTransactionManager {
elements.size() <= 1,
"Expected at most one entity of type %s, found at least two",
clazz.getSimpleName());
return elements.stream().findFirst();
return elements.stream().findFirst().map(this::detach);
}
private int internalDelete(VKey<?> key) {