This content has been marked as final. Show 1 reply
I previously had a ServletContextListener subclass where contextInitialized() would kill all timers and start them. The problem is, now if I have more nodes join the cluster, the timers are killed and recreated. Is there a better way to accomplish this?
I haven't tried it myself - but how about using a HASingleton @Service instead of the ServletContextListener?
Additionally, I thought maybe I could start the Timer in the @PostConstruct of the SLSBs themselves. However, this fails with
TimerService.getTimers should not be access from this bean method: IN_EJB_CREATE
As per the table in EJB3 spec, section 4.5.2 - methods on TimerService are not allowed to be invoked in the @PostConstruct of the bean.