Uploaded image for project: 'Tuscany'
  1. Tuscany
  2. TUSCANY-1508

ChangeSummaryImpl.getOldValues(DataObject) use of cachedSDOObjectChanges Map is not thread-safe

    XMLWordPrintableJSON

Details

    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

      Attachments

        Activity

          People

            Unassigned Unassigned
            rgavlin Ron Gavlin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: