X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=security%2Fimpl%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fusermgt%2Fjpa%2FJpaGroupSet.java;h=763fced4e464512ef6e927cecfb93be7785651ec;hb=476ab93a6ea0c57bbcc75594886de985ea8f04c2;hp=6d6cde0f684c3c2e155d3c8838b884fdfd6cacf8;hpb=c03650620dc44ee4a122023fa9951b6a7b97b530;p=utils diff --git a/security/impl/src/main/java/org/wamblee/usermgt/jpa/JpaGroupSet.java b/security/impl/src/main/java/org/wamblee/usermgt/jpa/JpaGroupSet.java index 6d6cde0f..763fced4 100644 --- a/security/impl/src/main/java/org/wamblee/usermgt/jpa/JpaGroupSet.java +++ b/security/impl/src/main/java/org/wamblee/usermgt/jpa/JpaGroupSet.java @@ -54,6 +54,10 @@ public class JpaGroupSet implements GroupSet { public void groupModified(Group aGroup) { assert aGroup.getPrimaryKey() != null; Group merged = em.merge(aGroup); + // Need to flush so that version of the merged instance is updated so we can use + // the updated version in the original group passed in. That allows the same + // group object to continue to be used as a detached object. + em.flush(); JpaMergeSupport.merge(merged, aGroup); }