Merge pull request #4458 from vramik/KEYCLOAK-5405

KEYCLOAK-5405 add synchronization of the persistence context when cre…
This commit is contained in:
Bill Burke 2017-09-11 18:49:33 -04:00 committed by GitHub
commit 1a74288413

View file

@ -418,6 +418,7 @@ public class JpaRealmProvider implements RealmProvider {
RealmEntity realmEntity = em.getReference(RealmEntity.class, realm.getId());
groupEntity.setRealm(realmEntity);
em.persist(groupEntity);
em.flush();
realmEntity.getGroups().add(groupEntity);
GroupAdapter adapter = new GroupAdapter(realm, em, groupEntity);