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