This content has been marked as final. Show 1 reply
You need to use some form of synchronization or locking.
You could make the getOutstandingAlerts() method and the method that updates the alerts synchronized.
You could also switch to using a ConcurrentHashMap, and ensure you have fully built the new Task before adding it.
Are you creating a new Task or changing an existing one? If you are changing an existing one you will need to synchronize around the whole usage of the task. You could instead create a clone.
...note sure what this has to do with TopLink though...