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.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@659036 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Catalina Wei 2008-05-22 08:05:00 +00:00
parent 72df500c6e
commit dcada13237
1 changed files with 5 additions and 1 deletions

View File

@ -270,6 +270,7 @@ public class DataCacheStoreManager
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 @@ public class DataCacheStoreManager
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);
}
/**