Skip to content

Commit

Permalink
Remove explicit flush from JPA user and client session handling
Browse files Browse the repository at this point in the history
Closes keycloak#29818

Signed-off-by: Alexander Schwartz <aschwart@redhat.com>
  • Loading branch information
ahus1 committed May 23, 2024
1 parent 4acf61d commit 7fc17c8
Showing 1 changed file with 0 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public void createUserSession(UserSessionModel userSession, boolean offline) {
entity.setData(model.getData());
entity.setBrokerSessionId(userSession.getBrokerSessionId());
em.persist(entity);
em.flush();
}

@Override
Expand Down Expand Up @@ -127,7 +126,6 @@ public void createClientSession(AuthenticatedClientSessionModel clientSession, b

if (!exists) {
em.persist(entity);
em.flush();
}
}

Expand All @@ -143,7 +141,6 @@ public void removeUserSession(String userSessionId, boolean offline) {
PersistentUserSessionEntity sessionEntity = em.find(PersistentUserSessionEntity.class, new PersistentUserSessionEntity.Key(userSessionId, offlineStr), LockModeType.PESSIMISTIC_WRITE);
if (sessionEntity != null) {
em.remove(sessionEntity);
em.flush();
}
}

Expand Down Expand Up @@ -176,8 +173,6 @@ public void removeClientSession(String userSessionId, String clientUUID, boolean
}
}
}

em.flush();
}
}

Expand Down

0 comments on commit 7fc17c8

Please sign in to comment.