[
https://jira.jboss.org/jira/browse/JBPM-1766?page=com.atlassian.jira.plug...
]
Tom Baeyens resolved JBPM-1766.
-------------------------------
Resolution: Rejected
That class doesn't have to be thread safe. Because we use hibernate, every
transaction has its own copy of the object. Even though the process definition
information is static. Hibernate will instantiate a copy for each transaction. Within
one transaction, there is only one thread.
Node.java getLeavingTransitionsMap() not thread safe when
constructing leavingTransitionMap
-------------------------------------------------------------------------------------------
Key: JBPM-1766
URL:
https://jira.jboss.org/jira/browse/JBPM-1766
Project: JBoss jBPM
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Core Engine
Affects Versions: jBPM 3.3.0 CR1
Environment: N/A
Reporter: joe freeman
Priority: Critical
The code in getLeavingTransitionsMap() lazily constructs the map the first time the
method is called. Our application can have 100s of users going through the same node at
the start of their shift. It is possible to have more than one user leaving the first node
at the same time in the same VM. This can put multiple users in the
getLeavingTransitionsMap() method at the same time. We can get deadlock in the put()
method for the map which means no one else can enter the application. The block of code
should be synchronized or the map should be synchronized.
A simpler fix is to just remove the map. The number of transitions exiting a node is
unlikely to ever be large enough to justify the complexity of two data structures pointing
at the same objects. Iterating across the list is almost always going to be close enough
in performance to remove the need for this map.
We're running just the jpdl which has this problem up through and including the
current 3.2.3 version
/**
* are the leaving {@link Transition}s, mapped by their name (java.lang.String).
*/
public Map getLeavingTransitionsMap() {
if ( (leavingTransitionMap==null)
&& (leavingTransitions!=null) ){
// initialize the cached leaving transition map
leavingTransitionMap = new HashMap();
ListIterator iter = leavingTransitions.listIterator(leavingTransitions.size());
while (iter.hasPrevious()) {
Transition leavingTransition = (Transition) iter.previous();
leavingTransitionMap.put(leavingTransition.getName(), leavingTransition);
}
}
return leavingTransitionMap;
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira