diff --git a/redisson/src/main/java/org/redisson/jcache/JCache.java b/redisson/src/main/java/org/redisson/jcache/JCache.java index ce2f8f804..68978e836 100644 --- a/redisson/src/main/java/org/redisson/jcache/JCache.java +++ b/redisson/src/main/java/org/redisson/jcache/JCache.java @@ -350,24 +350,6 @@ public class JCache extends RedissonObject implements Cache { return getAccessTimeout(System.currentTimeMillis()); } - V load(K key) { - RLock lock = getLockedLock(key); - try { - V value; - if (atomicExecution) { - value = getValue(key); - } else { - value = getValueLocked(key); - } - if (value == null) { - value = loadValue(key); - } - return value; - } finally { - lock.unlock(); - } - } - V loadValue(K key) { V value = null; try { @@ -829,9 +811,9 @@ public class JCache extends RedissonObject implements Cache { cacheManager.getStatBean(this).addHits(1); result.put(entry.getKey(), entry.getValue()); } else { + cacheManager.getStatBean(this).addMisses(1); if (config.isReadThrough()) { - cacheManager.getStatBean(this).addMisses(1); - V value = load(entry.getKey()); + V value = loadValue(entry.getKey()); if (value != null) { result.put(entry.getKey(), value); } diff --git a/redisson/src/main/java/org/redisson/jcache/JMutableEntry.java b/redisson/src/main/java/org/redisson/jcache/JMutableEntry.java index 25c5b262a..047f9025c 100644 --- a/redisson/src/main/java/org/redisson/jcache/JMutableEntry.java +++ b/redisson/src/main/java/org/redisson/jcache/JMutableEntry.java @@ -67,7 +67,7 @@ public class JMutableEntry implements MutableEntry { if (value != null) { action = Action.READ; } else if (isReadThrough) { - value = jCache.load(key); + value = jCache.loadValue(key); if (value != null) { action = Action.LOADED; }