0 Replies Latest reply on Jul 3, 2012 1:41 AM by mikedundee

    ejb timer service - delayed timers after shutdown




      I use EJB timer service in JBoss 6.1


      I experience strange behaviour:

      - set up persistent timer with repetition (let's say 5 minutes)

      - while jboss is running, everything is fine, timer.getNextTimeout() returns correct results

      - we shutdown the jboss and later start it again (server was down for let's say 1 hour)

      - timer is run immediately after startup (maybe because its getNextTimeout() is in the past)

      - while timer keeps running correctly after specified interval (5 minutes), its timer.getNextTimeout() still returns time in the past and never catches up (is 1 hour delayed).


      I checked TIMER table in DB (I have set up Oracle external storage) and could see that

      NEXTDATE column holds delayed data, PREVIOUSRUN is ok (time when it was really run).


      My problem is that I use timer.getNextTimeout() to generate reports to user of my system about when specified jobs (timers) will be triggered. And because shutdown this report is not valid.


      Is there any way how to make jboss timers catch up?

      I was thinking about some script, which would be run just before jboss startup  and which would alter data in TIMER table to actual time if it is delayed.