diff --git a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/InfinispanUserSessionProvider.java b/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/InfinispanUserSessionProvider.java index 033fe534bc..60bcb59c33 100644 --- a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/InfinispanUserSessionProvider.java +++ b/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/InfinispanUserSessionProvider.java @@ -395,7 +395,7 @@ public class InfinispanUserSessionProvider implements UserSessionProvider { throw new IllegalStateException("Can't remove session: task in progress for session"); } } else { - tasks.put(key, new CacheTask(cache, CacheOperation.ADD, key, value)); + tasks.put(key, new CacheTask(cache, CacheOperation.REPLACE, key, value)); } } @@ -426,6 +426,7 @@ public class InfinispanUserSessionProvider implements UserSessionProvider { break; case REPLACE: cache.replace(key, value); + break; } } } diff --git a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/mapreduce/ClientSessionMapper.java b/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/mapreduce/ClientSessionMapper.java index 7329d3fa88..369b7a6f5d 100644 --- a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/mapreduce/ClientSessionMapper.java +++ b/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/mapreduce/ClientSessionMapper.java @@ -80,7 +80,9 @@ public class ClientSessionMapper implements Mapper