3 Replies Latest reply on Jan 27, 2014 10:28 AM by wdfink

    How to prevent concurrent execution of scheduled methods in AS 7

    aolenev

      Hi,

      I have a method annotated as following:

      @Schedule(second = "*/10", minute = "*", hour = "*", persistent = false)
      public void run(){
          // some code here
      }
      

       

      It runs every 10 seconds as expected, but if I suspend thread inside run() method in debug mode JBoss triggers run() method invocation in another thread in parallel.

      So the question is: how to prevent parallel execution of scheduled method? What should I do if I need single threaded scheduling?