openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awh...@apache.org
Subject svn commit: r471831 - /incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheStoreManager.java
Date Mon, 06 Nov 2006 19:06:22 GMT
Author: awhite
Date: Mon Nov  6 11:06:21 2006
New Revision: 471831

URL: http://svn.apache.org/viewvc?view=rev&rev=471831
Log:
Fix possible NPEs resulting from Patrick's last DataCacheStoreManager commit.


Modified:
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheStoreManager.java

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheStoreManager.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheStoreManager.java?view=diff&rev=471831&r1=471830&r2=471831
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheStoreManager.java
(original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheStoreManager.java
Mon Nov  6 11:06:21 2006
@@ -571,9 +571,15 @@
         // and less write locks to do the mutation.
         ClassMetaData meta = sm.getMetaData();
         DataCache cache = meta.getDataCache();
+        if (cache == null)
+            return;
+
         cache.writeLock();
         try {
             DataCachePCData data = cache.get(sm.getId());
+            if (data == null)
+                return;
+
             boolean remove;
             switch (compareVersion(sm, sm.getVersion(), data.getVersion())) {
                 case StoreManager.VERSION_LATER:



Mime
View raw message