-
Bug
-
Resolution: Done
-
Major
-
jBPM 3.2.0
-
None
when more than 1 job executor thread is configured and concurrent async nodes are to be executed, it results in hibernate exceptions.
reason: job acquirement is not synchronized well, resulting in multiple threads trying to work on the same job.
In reproducing JBPM-983, I ran into Alex's JBPM-974 problem, which has already been closed. So I cloned it here.. let me know if that was incorrect process.
The problem was easy to reproduce, and was easy to predict in the first place. Alex's fix (sychronize on a static class member around acquireJobs()) works for me as well. It probably trivially improves performance, by avoiding aborted acquire attempts.
As noted in JBPM-974, it only causes an erroneous error message being emitted - the code operates correctly. It also makes debugging other race conditions much more difficult by injecting a lot of noise - they usually show up as stale objects as well.
I believe the reason the trace is dumped to the log is because it's dumped at ERROR level before it even gets to JBPM, in org.hibernate.event.def.AbstractFlushingEventListener.performExecutions. So the "catch (StaleStateException e)" doesn't suppress it - the horse has left the barn, the train has left the station, the s--t has already hit the fan - pick your favorite metaphor.