diff --git a/model/jpa/src/main/java/org/keycloak/models/jpa/JpaRealmProvider.java b/model/jpa/src/main/java/org/keycloak/models/jpa/JpaRealmProvider.java index 8c5f15c5c9..cd22a46fa9 100755 --- a/model/jpa/src/main/java/org/keycloak/models/jpa/JpaRealmProvider.java +++ b/model/jpa/src/main/java/org/keycloak/models/jpa/JpaRealmProvider.java @@ -117,7 +117,8 @@ public class JpaRealmProvider implements RealmProvider { for (String id : entities) { RealmModel realm = session.realms().getRealm(id); if (realm != null) realms.add(realm); - + em.flush(); + em.clear(); } return realms; } @@ -730,4 +731,4 @@ public class JpaRealmProvider implements RealmProvider { model.setTimestamp(entity.getTimestamp()); return model; } -} +} \ No newline at end of file