title: Running parallel schedules in JBoss 4.0.5.GA
body: <p>I am trying to define two schedulers in <code>jboss-service.xml</code>. One scheduler runs frequently and takes a short amount of time to execute. The other scheduler runs once every day, but takes a significant amount of time to execute. An excerpt of my <code>jboss-service.xml</code> follows:</p>
  
  <pre><code>&lt;!-- Frequent, fast --&gt;
  &lt;mbean code="org.jboss.varia.scheduler.Scheduler" 
         name=":service=FrequentSchedule,schedule=frequent"&gt;
      &lt;attribute name="InitialStartDate"&gt;NOW&lt;/attribute&gt;
      &lt;attribute name="SchedulePeriod"&gt;5000&lt;/attribute&gt;
      &lt;!-- Other attributes... --&gt;
  &lt;/mbean&gt;
  
  &lt;!-- Infrequent, slow --&gt;
  &lt;mbean code="org.jboss.varia.scheduler.Scheduler"
         name=":service=InfrequentSchedule,schedule=infrequent"&gt;
      &lt;attribute name="InitialStartDate"&gt;0&lt;/attribute&gt;
      &lt;attribute name="SchedulePeriod"&gt;86400000&lt;/attribute&gt;
      &lt;!-- Other attributes... --&gt;
  &lt;/mbean&gt;
  </code></pre>
  
  <p>The result of this configuration is that the frequent scheduler executes at the expected frequency until it is time to execute the long-running scheduler. At that point the frequent schedule is no longer executed until the long-running schedule completes. From the Javadocs of <code>org.jboss.varia.scheduler.Scheduler</code>:</p>
  
  <blockquote>
    <p>ATTENTION: The scheduler instance only allows to run one schedule at a time.
        Therefore when you want to run two schedules create to instances with this MBean.
        Suggested Object Name for the MBean are: :service=Scheduler,schedule=</p>
  </blockquote>
  
  <p>I tried to follow this advice, but it did not work. If anyone has any experience in getting more than one scheduler to run in parallel on JBoss 4.0.5.GA, any help will be much appreciated.</p>