From 5eee5262344772a0c8ae91a12146422f7f06fd9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Galder=20Zamarre=C3=B1o?= Date: Thu, 2 Feb 2012 09:50:10 +0100 Subject: [PATCH] HHH-1706 Support evictAll for LOCAL second level cache environments --- .../hibernate/cache/infinispan/util/CacheAdapterImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/util/CacheAdapterImpl.java b/hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/util/CacheAdapterImpl.java index 8ff02e3dad..7577ccce74 100644 --- a/hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/util/CacheAdapterImpl.java +++ b/hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/util/CacheAdapterImpl.java @@ -219,8 +219,12 @@ public class CacheAdapterImpl implements CacheAdapter { @Override public void broadcastEvictAll() { - EvictAllCommand cmd = cacheCmdInitializer.buildEvictAllCommand(cache.getName()); - cache.getRpcManager().broadcastRpcCommand(cmd, isSync); + RpcManager rpcManager = cache.getRpcManager(); + if (rpcManager != null) { + // Only broadcast evict all if it's clustered + EvictAllCommand cmd = cacheCmdInitializer.buildEvictAllCommand(cache.getName()); + rpcManager.broadcastRpcCommand(cmd, isSync); + } } @Override