This content has been marked as final.
Show 1 reply
-
1. Re: Execute TimerService().createTimer() exactly once in a c
jaikiran Sep 9, 2009 9:57 AM (in response to pgib)"pgib" wrote:
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?"pgib" wrote:
Additionally, I thought maybe I could start the Timer in the @PostConstruct of the SLSBs themselves. However, this fails withTimerService.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.