Skip to content

Commit 122a4b6

Browse files
committed
Add em.merge back into workingCopy
- we were too agressive removing this. when creating a working copy the entity needs to be saved after becoming the ancestor root (attributes are updated)
1 parent afa593e commit 122a4b6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

spring-versions-jpa/src/main/java/org/springframework/versions/impl/LockingAndVersioningRepositoryImpl.java

+1
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ public <S extends T> S workingCopy(S currentVersion) {
179179
S ancestorRoot;
180180
if (isAnestralRoot(currentVersion)) {
181181
currentVersion = (S)versioner.establishAncestralRoot(currentVersion);
182+
em.merge(currentVersion);
182183
ancestorRoot = currentVersion;
183184
} else {
184185
Object ancestorRootId = getAncestralRootId(currentVersion);

0 commit comments

Comments
 (0)