Troubleshooting
Problem
There are sometimes situations where, as a server load gets higher with more and more threads being created to run process or mediation flows, a ConcurrentModificationException exception can occur.
Symptom
A java.util.ConcurrentModificationException occurs in an environment where multiple users are executing the same mediation or process flows. Also, references to single shared Business Object instances are passed to these flows.
Cause
Business objects (BO) and, by extension, ServiceMessageObjects (SMO) are based on an underlying Eclipse Modeling Framework. This framework is very comprehensive as it allows you to associate and organize data objects into coherent, well-linked collections with well-defined parent, child, and sibling relationships. However, it was never designed to be thread-safe. When a BO/SMO instance is added as an attribute to another object, a linkage to the new parent is created and this shows as a modification to the object. When references to BO or SMO instances are passed across threads, each thread might take this object and add as an attribute to another BO or SMO for processing.
If a clone (deep copy) operation is performed on this object when it is being added in a secondary thread to another (parent) BO or SMO, this is seen as a modification to the object. As all attributes are stored in internal collections in EMF objects, the java.util.ConcurrentModificationException is thrown when the copy operation attempts to iterate through the collection members.
Environment
Any environment where multiple executed using BPC process flows or Mediation flows are executed concurrently.
Diagnosing The Problem
The log files need to be consulted. Find the timestamp and thread where the java.util.ConcurrentModificationException exception is thrown and search the timestamp for a different thread that might be acting against that same BO or SMO object instance.
Resolving The Problem
The symptom is caused by a basic violation of the concurrent programming paradigm. This problem is not limited to WebSphere Process Server, WebSphere Enterprise Service Bus, or even Java™. It is a basic problem with any programming system that allows two threads of execution access a single object instance. The guideline is simple: Either serialize access to the object so that two execution threads cannot access this object concurrently or pass a copy of the object to each thread.
In the case illustrated in this technote, there is a BO or SMO that is being accessed by two threads concurrently. One is copying the object while another is updating it (changing its parent). This approach is illegal in concurrent programming.
To correct this situation, ensure that references to a single object are never passed to multiple threads. Instead, always make a clone of the shared object to be used exclusively by each single thread.
Product Synonym
WPS
Was this topic helpful?
Document Information
More support for:
WebSphere Process Server
Software version:
7.0.0.4, 7.0.0.3, 7.0.0.2, 7.0.0.1, 7.0, 6.2.0.3, 6.2.0.2, 6.2.0.1, 6.2, 6.1.2.3, 6.1.2.2, 6.1.2.1, 6.1.2, 6.1.0.4, 6.1.0.3, 6.1.0.2, 6.1.0.1, 6.1
Operating system(s):
AIX, HP-UX, Linux, Solaris, Windows, z/OS, IBM i
Document number:
163059
Modified date:
15 June 2018
UID
swg21504172