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=0dd127ebfc98d49c18d3b1d8157d0d85e77b572a;hp=6d6cde0f684c3c2e155d3c8838b884fdfd6cacf8;hpb=03a7ad865b594ca2e46862d15b53fb559a96c7d0;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); }