3 Replies Latest reply on Oct 25, 2005 11:39 AM by koen.aers

    Scheduler Thread question

    jnjintc

      Hi,

      Is there a problem starting the JBPM scheduler from a EJB stateless session bean. I have read that an EJB should not manage or create threads and I was wondering if this might cause a problem ?

      thanks,
      Adam

        • 1. Re: Scheduler Thread question
          koen.aers

          Adam,

          I would indeed not recommend this. The only generic tool you have for starting threads in a J2EE container is by spawning it off when a servlet starts. EJB's should not spawn threads, becaus you don't have direct control over their lifecycle.
          The alternatives you have are either writing a standalone Java application that spawns a thread and polls the database and then maybe install this application as a system service or using the non-standard services that a J2EE container, such as JBoss AS, provide to run services.

          Regards,
          Koen

          • 2. Re: Scheduler Thread question
            jnjintc

            Thanks.
            Would a JBoss JMX MBean work to start and stop the scheduler ?
            If so, isn't JMX considered a standard ?

            thanks,
            Adam

            • 3. Re: Scheduler Thread question
              koen.aers

              This would indeed work. But the JBoss MBean mechanism, though using the JMX standard, is not at all a 'standard'.

              Regards,
              Koen