openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fa...@apache.org
Subject svn commit: r659036 - /openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheStoreManager.java
Date Thu, 22 May 2008 08:05:01 GMT
Author: fancy
Date: Thu May 22 01:05:00 2008
New Revision: 659036

URL: http://svn.apache.org/viewvc?rev=659036&view=rev
Log:
OPENJPA-574 Cached object in DataCache not evicted due to StatementBatching not reporting
OptimisticException 
Handle  (-2) updateCount returned from Batching for Oracle.
Got a ClassCasstException while testing multiple entries in DataCache needed to be removed
due to OptimisticException.

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

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheStoreManager.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheStoreManager.java?rev=659036&r1=659035&r2=659036&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheStoreManager.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/DataCacheStoreManager.java
Thu May 22 01:05:00 2008
@@ -270,6 +270,7 @@
             idList.add(holder.sm.getObjectId());
         }
 
+        List<PCDataHolder> removes = new ArrayList<PCDataHolder>();
         Map<Object,DataCachePCData> pcdatas = cache.getAll(idList);
         for (Entry<Object,DataCachePCData> entry : pcdatas.entrySet()) {
             Integer index = ids.get(entry.getKey());
@@ -277,10 +278,13 @@
             PCDataHolder holder = (PCDataHolder) holders.get(index);
             if (oldpc != null && compareVersion(holder.sm,
                 holder.sm.getVersion(), oldpc.getVersion()) == VERSION_EARLIER)
-                holders.remove(index);
+                removes.add(holder);
             else
                 holders.set(index, holder.pcdata);
         }
+
+        for (PCDataHolder holder : removes)
+            holders.remove(holder);
     }
 
     /**



Mime
View raw message