1 Reply Latest reply on Dec 16, 2004 5:03 AM by Gerald Quintana

    How do JBoss TimerService handle system failures?

    da_alchemist Newbie

      JBoss: 4.0.0 and 4.0.1RC2

      Here a some general questions about the behaviour of JBoss' timer service.

      1. If a timer expires once while the system goes down, will it go off when the system starts up again?

      2. If a single timer expires multiple times while the system is down, what happens to the timer when the system starts up again?

      3. Does JBoss provide a way to specify an end date for a timer?

        • 1. Re: How do JBoss TimerService handle system failures?
          Gerald Quintana Newbie

           

          1. If a timer expires once while the system goes down, will it go off when the system starts up again?

          It depends on how your JBoss is stopped:
          - Normal stop: all the timers are removed automatically (what a pity!) so they won't be restored on startup
          - Anormal (kill/crash) stop: all timers are restored provided that they were made persistent (see ejb-deployer.xml config file)

          2. If a single timer expires multiple times while the system is down, what happens to the timer when the system starts up again?

          If it wasn't removed on shutdown, il will be executed once on startup and then the normal behaviour will occur.

          3. Does JBoss provide a way to specify an end date for a timer?

          You can stop a timer using the cancel method on it. You can use a time-out style timer to stop periodical style timer.