diff --git a/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/query/QueryResultsRegionImpl.java b/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/query/QueryResultsRegionImpl.java index 02573343ca..74b2ec03c0 100644 --- a/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/query/QueryResultsRegionImpl.java +++ b/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/query/QueryResultsRegionImpl.java @@ -71,7 +71,7 @@ public class QueryResultsRegionImpl extends TransactionalDataRegionAdapter imple Option opt = getNonLockingDataVersionOption(false); if (localOnly) opt.setCacheModeLocal(true); - CacheHelper.remove(getCacheInstance(), getRegionFqn(), key, opt); + CacheHelper.removeNode(getCacheInstance(), getRegionFqn(), key, opt); } public void evictAll() throws CacheException { @@ -79,6 +79,8 @@ public class QueryResultsRegionImpl extends TransactionalDataRegionAdapter imple if (localOnly) opt.setCacheModeLocal(true); CacheHelper.removeAll(getCacheInstance(), getRegionFqn(), opt); + // Restore the region root node + CacheHelper.addNode(getCacheInstance(), getRegionFqn(), false, true, null); } public Object get(Object key) throws CacheException {