Remove explicit flush from JPA user and client session handling (#29819)

Closes #29818

Signed-off-by: Alexander Schwartz <aschwart@redhat.com>
This commit is contained in:
Alexander Schwartz 2024-05-28 09:23:20 +02:00 committed by GitHub
parent b5d0154bb1
commit 97cc973af0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -84,7 +84,6 @@ public class JpaUserSessionPersisterProvider implements UserSessionPersisterProv
entity.setData(model.getData()); entity.setData(model.getData());
entity.setBrokerSessionId(userSession.getBrokerSessionId()); entity.setBrokerSessionId(userSession.getBrokerSessionId());
em.persist(entity); em.persist(entity);
em.flush();
} }
@Override @Override
@ -127,7 +126,6 @@ public class JpaUserSessionPersisterProvider implements UserSessionPersisterProv
if (!exists) { if (!exists) {
em.persist(entity); em.persist(entity);
em.flush();
} }
} }
@ -143,7 +141,6 @@ public class JpaUserSessionPersisterProvider implements UserSessionPersisterProv
PersistentUserSessionEntity sessionEntity = em.find(PersistentUserSessionEntity.class, new PersistentUserSessionEntity.Key(userSessionId, offlineStr), LockModeType.PESSIMISTIC_WRITE); PersistentUserSessionEntity sessionEntity = em.find(PersistentUserSessionEntity.class, new PersistentUserSessionEntity.Key(userSessionId, offlineStr), LockModeType.PESSIMISTIC_WRITE);
if (sessionEntity != null) { if (sessionEntity != null) {
em.remove(sessionEntity); em.remove(sessionEntity);
em.flush();
} }
} }
@ -176,8 +173,6 @@ public class JpaUserSessionPersisterProvider implements UserSessionPersisterProv
} }
} }
} }
em.flush();
} }
} }