Always do a (potentially distributed) cache remove on invalidation, regardless of what's in the local cache. From Kyle Sampson.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2335 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -371,10 +371,7 @@ public class PersistenceContext
|
|||||||
|
|
||||||
CacheAdapter.CacheBin<T> bin = _cache.getCache(cacheId);
|
CacheAdapter.CacheBin<T> bin = _cache.getCache(cacheId);
|
||||||
CacheAdapter.CachedValue<T> element = bin.lookup(cacheKey);
|
CacheAdapter.CachedValue<T> element = bin.lookup(cacheKey);
|
||||||
if (element == null) {
|
if (element != null) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// find the old entry, if any
|
// find the old entry, if any
|
||||||
T oldEntry = element.getValue();
|
T oldEntry = element.getValue();
|
||||||
if (oldEntry != null) {
|
if (oldEntry != null) {
|
||||||
@@ -390,9 +387,9 @@ public class PersistenceContext
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// then evict the keyed entry, if needed
|
// then remove the keyed entry from the cache system
|
||||||
log.debug("evicting [cacheKey=" + cacheKey + "]");
|
|
||||||
bin.remove(cacheKey);
|
bin.remove(cacheKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user