Should EJB Timers Be Persistent / Reliable?

eg. if I set a timer to expire every day at midnight, what happens if one “skips” (does not call back because the server is down, for example)? I can not find this in the documentation.

Is there a way to make this timer initiate a callback as it restarts?

PS: I know about Quartz, I rate EJB timers as an alternative.

+6
java java-ee timer ejb
source share
2 answers

You can use TimerHandle to make the timer persistent. EJB time is for container survival.

See the article for a comparison between EJB times and other scheduler systems such as Quartz.

+4
source share

From experience, I can tell you that in Glassfish, a missed timer will light up as soon as the server returns. If your server is disabled for two or more missed timeouts, it will start only once, and not once for each missed timeout. He then returns to your regularly scheduled program.

+3
source share

All Articles