Sunday, February 5, 2012

StaleObjectStateException on JBPM4

When I was doing some testing to my recently implemented JBPM4 process, I faced a really ugly error, which ended abruptly my process :(

Could not synchronize database state with session
org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.pvm.internal.job.TimerImpl#17]

After researching on Jboss.org, I just found very few bread crumbs instead of the whole slice of bread:
StaleObjectException on Timer execution
My process was different, because mine was completely ASYNC, then I realize, what would happen if I make SYNC just the WAIT state (which was causing the problem) and keep ASYNC my other states. After my first test, I got what I was expecting :D

3 comments:

  1. Wow what a nice post. I am impressed and fell glad to come upon here.

    Thanks for more sharing.......



    zvnproperties

    ReplyDelete
    Replies
    1. Thanks, I'm glad my posts are helping others :)

      Delete
  2. Hi Juan, I am very new to JBPM. I am using JBPM v3.2 with SEAM. In my JBPM process there is a wait-state with a timer and which repeatedly executes next tasks. I am getting the same error(StaleObjectStateException). I am not very much clear about what you have explained in this post. I marked my wait-state as asynchronous but which didn't solve the issue? Is that what you suggests? Pls help.

    ReplyDelete