diff --git a/model/infinispan/src/main/java/org/keycloak/models/authorization/infinispan/CachedPolicyStore.java b/model/infinispan/src/main/java/org/keycloak/models/authorization/infinispan/CachedPolicyStore.java index 5178afc2f4..02800cecdf 100644 --- a/model/infinispan/src/main/java/org/keycloak/models/authorization/infinispan/CachedPolicyStore.java +++ b/model/infinispan/src/main/java/org/keycloak/models/authorization/infinispan/CachedPolicyStore.java @@ -70,7 +70,7 @@ public class CachedPolicyStore implements PolicyStore { @Override public void delete(String id) { getDelegate().delete(id); - this.transaction.whenComplete(() -> cache.remove(id)); + this.transaction.whenComplete(() -> cache.remove(getCacheKeyForPolicy(id))); } @Override diff --git a/model/infinispan/src/main/java/org/keycloak/models/authorization/infinispan/CachedResourceStore.java b/model/infinispan/src/main/java/org/keycloak/models/authorization/infinispan/CachedResourceStore.java index 9e1ea14fba..aa587f5ce3 100644 --- a/model/infinispan/src/main/java/org/keycloak/models/authorization/infinispan/CachedResourceStore.java +++ b/model/infinispan/src/main/java/org/keycloak/models/authorization/infinispan/CachedResourceStore.java @@ -64,7 +64,7 @@ public class CachedResourceStore implements ResourceStore { @Override public void delete(String id) { - this.cache.evict(getCacheKeyForResource(id)); + this.cache.remove(getCacheKeyForResource(id)); getDelegate().delete(id); }