From 7f1c03a122ad74fc9041a9b90c3beb685c26ace7 Mon Sep 17 00:00:00 2001 From: Hynek Mlnarik Date: Fri, 5 Oct 2018 13:21:23 +0200 Subject: [PATCH] KEYCLOAK-8462 Close delegates properly --- .../infinispan/authorization/StoreFactoryCacheSession.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/authorization/StoreFactoryCacheSession.java b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/authorization/StoreFactoryCacheSession.java index 04e6eb7056..89ae8d6ada 100644 --- a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/authorization/StoreFactoryCacheSession.java +++ b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/authorization/StoreFactoryCacheSession.java @@ -147,6 +147,9 @@ public class StoreFactoryCacheSession implements CachedStoreFactoryProvider { } public void close() { + if (delegate != null) { + delegate.close(); + } } private KeycloakTransaction getPrepareTransaction() { @@ -193,10 +196,6 @@ public class StoreFactoryCacheSession implements CachedStoreFactoryProvider { @Override public void commit() { try { - if (getDelegate() == null) return; - if (clearAll) { - cache.clear(); - } runInvalidations(); transactionActive = false; } finally {