JBoss Community

jBpm4.4 +spring test error(Could not synchronize database state with session)?

reply from Michael Wohlfart in jBPM - View the full discussion

I have a similar issue and I think there is a race condition between the DispatcherThread that handles the execution of async Messages/Jobs and the main-Thread. Both alter data in the JBPM4_JOB table, I think this is what is going on:

 

  1. main-Thread is running along, minding his own business and creates a hibernate-Session
  2. DispatcherThread wakes up and also creates a hibernate-Session accessing data in the JBPM4_JOB table
  3. DispatcherThread did its work and removes the Job data from the JBPM4_JOB table
  4. main-Thread ends an execution and deletes the execution related data from the JBPM4_JOB table,
    since the same data have been altered by different session there is an exception at this point

Reply to this message by going to Community

Start a new discussion in jBPM at Community