Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Duplicate
-
Java-SDO-Next
-
None
Description
Invoking ChangeSummaryImpl.getOldValues(DataObject) from multiple threads results in a HashMap.get(Object) infinite loop. Here is the stack track:
HashMap.get(Object) line: 323
ChangeSummaryImpl.getOldValues(DataObject) line: 581
...
The problem appears to be that the protected cachedSDOObjectChanges HashMap has no synchronization. Normally, synchronizing this type of collections class instance is not the most performant solution to this type of problem. However, based on the way this map is used within this class, I think synchronizing the HashMap is a reasonable, straight-forward solution. Here is my proposed change:
OLD:
protected HashMap cachedSDOObjectChanges = new HashMap();
NEW
protected Map cachedSDOObjectChanges = Collections.synchronizedMap(new HashMap());
Thoughts?
- Ron