3 Replies Latest reply on May 22, 2014 3:42 AM by Maciej Swiderski

    StaleObjectStateException using Quartz for timers

    Evan James Knowles Newbie

      I've switched to using Quartz for timers. Everything appears to be going fine, but occasionally (especially after bouncing the server so the jobs are all going at once) I get a StaleObjectStateException when trying to update ProcessInstanceInfo.

       

      Why would this be happening? Surely there's only one trigger happening per ProcessInstanceInfo so they shouldn't be being modified more than once? The server recovers after the retry, but the logs are extremely messy and obviously somewhat slower.

       

      Is there a way that I can prevent this from happening? Thanks.

        • 1. Re: StaleObjectStateException using Quartz for timers
          Maciej Swiderski Master

          there must be something that tries to modify the process instance concurrently and most likely it might be timers that fire on server startup. So could be good to try to pin point what is actually happening by reducing number of instances and try to enable some logging to identify what gets in the way. Without more details on the process definitions and your configuration (what strategy do you use) it's hard to come up with any ideas.

           

          HTH

          • 2. Re: StaleObjectStateException using Quartz for timers
            Evan James Knowles Newbie

            Hey,

             

            I'm still devving, so my setup is currently a single jBoss 6.2 server pointing at an Oracle 11g database. I'm using all defaults for the timers (so Optimistic locking) obviously with Quartz scheduling and with Quartz wrapping the execution in a user transaction.

             

            This does occasionally occur when the server is rebooted, but I can reproduce it by starting several timers that end up triggering at around the same time.

             

            In my most recent test I noticed that the final timer fired, and after it completed successfully I picked up several errors on my console.

             

            They appeared to be from the system loading a session snapshot and rescheduling triggers - I assume that would definitely create the error I'm seeing, do you know what would be causing this?

            • 3. Re: StaleObjectStateException using Quartz for timers
              Maciej Swiderski Master

              Could you describe detailed steps on how you managed to reproduce it, feel free to drop a jira for it. Once I know how to reproduce it then I'll try to fix it. Processes that are used for that would be useful to have as well so we do reproduce same scenario.

               

              Cheers