(no commit message)
[utils] / security / impl / src / main / java / org / wamblee / usermgt / jpa / JpaGroupSet.java
index 6d6cde0f684c3c2e155d3c8838b884fdfd6cacf8..763fced4e464512ef6e927cecfb93be7785651ec 100644 (file)
@@ -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);
     }