Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are EJB Timers supposed to be persistent/reliable?

E.g. if I set a timer to expire every day at midnight, what will happen if one "misfire" (does not trigger the callback because the server is down, for instance) ? I can't find that in the documentation.

Is there a way to make this timer triggers the callback as soons as the server restart ?

PS: I know about Quartz, i'm evaluating EJB timers as an alternative.

like image 797
BraveSirFoobar Avatar asked Dec 30 '08 10:12

BraveSirFoobar


2 Answers

You can use a TimerHandle to make a timer persistent. EJB times were designed to survive container crashes.

See this article for a comparison between EJB times and other scheduler systems like Quartz.

like image 150
kgiannakakis Avatar answered Oct 24 '22 05:10

kgiannakakis


From experience, I can tell you that in Glassfish a missed timer will fire as soon as the server is back up. If your server is down for two or more missed timeouts it will only fire once, not once for each missed timeout. It then goes back to your regularly scheduled program.

like image 24
Relic Avatar answered Oct 24 '22 06:10

Relic