java ee - EJB TimerService Behavior -


i have application working timerservice, creating few timers run specific tasks. working fine. however, noticing delay in timeouts. have timeout "a" scheduled run every 10 minutes , "b" run every 3 minutes. if "a" takes 5 minutes run, "b" run after "a" ends, causing 2 minutes delay.it problem, because things not ready when supposed be. question is, if there way timerservice run simultaneously. pieces of code i'm using below. appreciate help.

schedule creation:

// every schedule extend class. public abstract class schedule { @resource private timerservice timerservice;  public void start() {         timerconfig timerconfig = new timerconfig();         timerconfig.setinfo(name);         timerconfig.setpersistent(false);         timerservice                 .createcalendartimer(this.calendarschedule, timerconfig); }  } 

schedule implementation:

@named @stateless  public class myscheduleejb extends schedule {    @timeout    public void timeout(timer timer) {     // work    }  } 

it specific situation in application server. if else have same problem, there configuration in websphere (not sure others as) tells how many threads timer pools should use. default 1, that's why not running simultaneously. configuration:was config


Comments