diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheStoreManager.java b/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheStoreManager.java index 6bbb5baf9..dab3e4d24 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheStoreManager.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheStoreManager.java @@ -380,6 +380,9 @@ public class DataCacheStoreManager return false; if (!_ctx.getPopulateDataCache()) return true; + // Do not load changes into cache if the instance has been flushed + if (sm.isFlushed()) + return true; // make sure that we're not trying to cache an old version cache.writeLock();