2 Replies Latest reply on Sep 18, 2008 11:18 AM by bravocharlie.seam.signup.benny.me.uk

    Any idea why cron trigger does not fire first time?

    samdoyle

      My job never fires the first time but does trigger on later intervals.
      Any ideas?
      Thanks.



      @Name( "indexerController" )
      @AutoCreate
      @Startup
      @MethodLogging
      public class IndexerControllerComponent
      {
         ...
         @In
         IndexerAction indexer;
         private static final String CRONSTRING = "0 0 0 * * ? *"; 
      
         @Create
         public void scheduleTimer()
         {
            //For some reason the async method does not trigger immediately
      
            indexer.doIndexAsync( new Date(), CRONSTRING );
         }
      }
      
      @Name( "indexer" )
      @AutoCreate
      @Scope( ScopeType.APPLICATION )
      @MethodLogging
      public class IndexerAction
      
      {
         ...
         @Transactional
         @TransactionTimeout( 1800 )
         @Asynchronous
         /* This method never fires the first time */
         public QuartzTriggerHandle doIndexAsync( @Expiration Date when, @IntervalCron String cron )
         {
           ...
      }