1 Reply Latest reply on Aug 12, 2010 12:48 AM by vijay karmani

    Issue with Scheduler

    Jon Aharrah Newbie

      Hello everyone,

       

      Hopefully I can get some info on why this may be happening, or some kind of workaround.  I currently have a Scheduler set up to run on a daily basis at 10pm.  Here is the configuration in the jboss-service.xml for my service:

       

      <mbean code="org.jboss.varia.scheduler.Scheduler" name="Client-ScheduledServices:service=DailyEmailSchedulable">
        <attribute name="StartAtStartup">true</attribute>
        <attribute name="SchedulableClass">com.client.processing.DailyEmailSchedulable</attribute>
        <attribute name="SchedulableArguments">500</attribute>
              <attribute name="SchedulableArgumentTypes">int</attribute>

        <attribute name="InitialStartDate">9/23/2009 10:00 pm</attribute>
        <attribute name="SchedulePeriod">86400000</attribute>
        <attribute name="InitialRepetitions">-1</attribute>
        <depends>jboss.jca:service=DataSourceBinding,name=jdbc/ClientDS</depends>
      </mbean>

       

      What I've noticed is that the schedule period begins once the schedule completes processing, instead of from when it initially started.  So if it started at 10pm today and ran to 10:40pm, it would start 86400000 milliseconds after the previous run completed, at 10:40pm the next day.  After a couple days, the times get pushed pretty far from the original start time without a server restart.

       

      My question is - is there something I can do configuration-wise to force the job to always start at 10pm every day?  I'm running JBoss 4.0.2, for what it's worth...

       

      One other side question on using the Scheduler - is there anything you can do to take daylight savings into account?  I'm guessing not, since it's just running off of a start date and schedule period, but maybe someone has run into this and had a solution for it without having to change the start date every time it changes.

       

      Thanks,

      Jon