KEYCLOAK-1999 KC server doesn't start on EAP 6.4 in local mode on PostgreSQL
This commit is contained in:
parent
23546402fa
commit
e04dbffb88
3 changed files with 29 additions and 21 deletions
|
@ -188,6 +188,7 @@ public class JpaUserSessionPersisterProvider implements UserSessionPersisterProv
|
||||||
userSessionIds.add(entity.getUserSessionId());
|
userSessionIds.add(entity.getUserSessionId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!userSessionIds.isEmpty()) {
|
||||||
TypedQuery<PersistentClientSessionEntity> query2 = em.createNamedQuery("findClientSessionsByUserSessions", PersistentClientSessionEntity.class);
|
TypedQuery<PersistentClientSessionEntity> query2 = em.createNamedQuery("findClientSessionsByUserSessions", PersistentClientSessionEntity.class);
|
||||||
query2.setParameter("userSessionIds", userSessionIds);
|
query2.setParameter("userSessionIds", userSessionIds);
|
||||||
query2.setParameter("offline", offlineStr);
|
query2.setParameter("offline", offlineStr);
|
||||||
|
@ -211,8 +212,7 @@ public class JpaUserSessionPersisterProvider implements UserSessionPersisterProv
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class SimpleUserSessionInitializer {
|
||||||
public void run(KeycloakSession session) {
|
public void run(KeycloakSession session) {
|
||||||
int count = sessionLoader.getSessionsCount(session);
|
int count = sessionLoader.getSessionsCount(session);
|
||||||
|
|
||||||
for (int i=0 ; i<=count ; i+=sessionsPerSegment) {
|
for (int i=0 ; i<count ; i+=sessionsPerSegment) {
|
||||||
sessionLoader.loadSessions(session, i, sessionsPerSegment);
|
sessionLoader.loadSessions(session, i, sessionsPerSegment);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -290,6 +290,14 @@ public class UserSessionPersisterProviderTest {
|
||||||
realmMgr.removeRealm(realmMgr.getRealm("foo"));
|
realmMgr.removeRealm(realmMgr.getRealm("foo"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// KEYCLOAK-1999
|
||||||
|
@Test
|
||||||
|
public void testNoSessions() {
|
||||||
|
UserSessionPersisterProvider persister = session.getProvider(UserSessionPersisterProvider.class);
|
||||||
|
List<UserSessionModel> sessions = persister.loadUserSessions(0, 1, true);
|
||||||
|
Assert.assertEquals(0, sessions.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private ClientSessionModel createClientSession(ClientModel client, UserSessionModel userSession, String redirect, String state, Set<String> roles, Set<String> protocolMappers) {
|
private ClientSessionModel createClientSession(ClientModel client, UserSessionModel userSession, String redirect, String state, Set<String> roles, Set<String> protocolMappers) {
|
||||||
ClientSessionModel clientSession = session.sessions().createClientSession(realm, client);
|
ClientSessionModel clientSession = session.sessions().createClientSession(realm, client);
|
||||||
|
|
Loading…
Reference in a new issue