Are EJB Timers supposed to be persistent/reliable?
Asked Answered
E

2

6

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.

Eben answered 30/12, 2008 at 10:15 Comment(0)
J
4

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.

Jute answered 30/12, 2008 at 10:44 Comment(0)
C
3

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.

Clamatorial answered 1/1, 2009 at 7:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.