diff --git a/hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/util/CacheHelper.java b/hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/util/CacheHelper.java index 984f6c63cc..923c2b06a2 100644 --- a/hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/util/CacheHelper.java +++ b/hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/util/CacheHelper.java @@ -50,12 +50,12 @@ public class CacheHelper { public static void initInternalEvict(CacheAdapter cacheAdapter, AddressAdapter member) { EvictAll eKey = new EvictAll(member == null ? NoAddress.INSTANCE : member); - cacheAdapter.withFlags(FlagAdapter.CACHE_MODE_LOCAL).put(eKey, Internal.INIT); + cacheAdapter.withFlags(FlagAdapter.CACHE_MODE_LOCAL, FlagAdapter.SKIP_CACHE_LOAD).put(eKey, Internal.INIT); } public static void sendEvictAllNotification(CacheAdapter cacheAdapter, AddressAdapter member) { EvictAll eKey = new EvictAll(member == null ? NoAddress.INSTANCE : member); - cacheAdapter.put(eKey, Internal.EVICT); + cacheAdapter.withFlags(FlagAdapter.SKIP_CACHE_LOAD).put(eKey, Internal.EVICT); } public static boolean isEvictAllNotification(Object key) { diff --git a/hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/util/FlagAdapter.java b/hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/util/FlagAdapter.java index f4f7a3a308..b4d329bf0f 100644 --- a/hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/util/FlagAdapter.java +++ b/hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/util/FlagAdapter.java @@ -36,7 +36,8 @@ public enum FlagAdapter { CACHE_MODE_LOCAL, FORCE_ASYNCHRONOUS, FORCE_SYNCHRONOUS, - SKIP_CACHE_STORE; + SKIP_CACHE_STORE, + SKIP_CACHE_LOAD; Flag toFlag() { switch(this) { @@ -50,6 +51,8 @@ public enum FlagAdapter { return Flag.FORCE_SYNCHRONOUS; case SKIP_CACHE_STORE: return Flag.SKIP_CACHE_STORE; + case SKIP_CACHE_LOAD: + return Flag.SKIP_CACHE_LOAD; default: throw new CacheException("Unmatched Infinispan flag " + this); }