3 Replies Latest reply on Nov 7, 2005 5:06 AM by borje.jonsson

    Problem with EJB timer perssistance

    borje.jonsson

      Hello,

      I don't get timerbean persistance to work at all.
      I have created a stateless sessionbean that implements TimedObject. When i call the business metod initializeTimer(...) ejbTimeout(Timer) is called as expected and the call is repeated every other minute.

      The problem is that the timer is not persisted and never restored if Jboss is shutdown and restarted. Is there anything i have missed?

      I use Jboss 4.0.2.

      public class CurrencyReaderBean implements SessionBean, TimedObject
      
       private TimerHandle timerHandle = null;
      
       public void initializeTimer(Date startTime, long timeout, String id)
       {
       TimerService timerService = ctx.getTimerService();
       Timer timer = timerService.createTimer(startTime, timeout, id);
       this.timerHandle = timer.getHandle();
       }
      
       public void ejbTimeout(Timer timer)
       {
       String id = (String)timer.getInfo();
       logManager.info("ejbTimeout, id is: " + id);
       }
      }