1 Reply Latest reply on Dec 17, 2013 2:21 AM by wdfink

    Possible issue: Persistent=false for @Schedule doesn't work in JBoss AS 7.1.1

    renannp

      Hello, guys.

       

      I'm writing this post here because there was nobody that helped me in stackoverflow and I really haven't found the answer to this.

       

      So I`ll reproduce my question here:

       

      What I understand from the below code is that whenever the server either crash or I stop the deployed artifact inside the server, the Persistent=false should clean the timer meaning that whenever the application starts again, it won't try to run jobs that should have been ran before. Which is not happening. So from my point of view, this is a bug from JBoss AS 7.1.1, but I couldn't find fix/workaround for this.

       

      @Singleton
      public class RetrieveScheduledJob

        @Schedule(minute = "0,10,20,30,40,50", hour = "*", persistent = false)
        synchronized public void runRetrieve() throws InterruptedException
      .
      .
      .
      }

       

      Another minor issue is that, because of the above issue, I might have the same job running in parallel. I tried to fix with synchronized and @Singleton, but maybe I`m missing something.

      JDK1.7_u45

      JBoss AS 7.1.1

      Link to stackoverflow question: http://stackoverflow.com/questions/20416284/persistent-false-for-schedule-doesnt-work-in-jboss-as-7-1-1

       

      If you guys have at least a workaround for this issue, it would be nice.

       

      Thank you