Not sure, but I have the impression that this could be a locking issue. Do you lock your process instances somewhere?
No, I don't lock the process instance. (Should I ?)
Could anyone summarize (1) when I would need to lock a process instance and (2) when I should be saving a process instance to the datbase?
Solved. My application communicates with JBPM via Rendezvous (Tibco) messages. I was incorrectly passing a JNI environment pointer (JNIEnv*) through the callback to the listening thread. You need to maintain or create a pointer to the JVM, and allocate a new JNIENV pointer in each thread.
Creating a new JNIEnv pointer in the listening thread eliminated my random JVM hangups.
who knew?Nobody, because you didn't mention it earlier ;-)
Back when I was in college I programmed a neural network in C++ with a Java front-end. Every n cycles the processing code would pause and notify the front end of its progress. And also at random the program freezed with no apparent reason. It turned out that the first few lines of native code I wrote and later forgot about, mistakenly kept local references to classes.
Oh, subtle, mysterious world of native programming.