mirror of https://github.com/apache/openjpa.git
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:
parent
72df500c6e
commit
dcada13237
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue