Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-1394

TimerService.getTimers() does not seem to work when called at ServletContextListener.contextInitialised time

XMLWordPrintable

      I have a stateless session bean that implements TimedObject. It has a schedule() method that gets called from the contextInitialized method of a WebApp. The schedule method first calls getTimers() and cancels any timers it finds, it then creates new ones. This call to getTimers never finds any existing timers, even though they exist in the TIMERS table in the DB. The net effect is, that after a reboot, I end up with duplicate timers.

      If I call the same schedule() method from a client program at a later time, it correctly finds and cancels all extant timers before creating new ones.

      From looking at the debug log, it appears that the restore
      DEBUG [org.jboss.ejb.txtimer.DatabasePersistencePolicy] Restoring 2 timer(s)
      is happening sometime after contextInitialized gets called.

      This problem is repeatable.

      Steve

            dandread1@redhat.com Dimitrios Andreadis
            stevebostock_jira Steve Bostock (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: