[jboss-user] [EJB 3.0 Users] - Re: Execute TimerService().createTimer() exactly once in a c

jaikiran do-not-reply at jboss.com
Wed Sep 9 09:57:53 EDT 2009


"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 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.
 

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4254193#4254193

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4254193



More information about the jboss-user mailing list