开发者

ejb timer service vs cron

Ejb timer service can start some process in desired time intervals.

Also we can do the same thing with cron (min 1 minute) interval.

But doing it with cron we have more power on controlling, monitoring and changing the intervals. Also we can restart if needed the cron very easily by command line. Also we can add or remove lines in the cron transparently.

What are the advantages of using ejb timer services over calling the ejbs from cron ?

(several lines of code in the cron classes are not a problem)

开发者_如何学Python

Regards.


EJB Timers can be persistent and survive a crash: a missed timer will get triggered when the server is restarted.

Not sure how you could handle that if you cron an EJB client.


The cron timer will also fire if your application is not running while the EJB timers will be stopped. Also, you can do more complex operations from inside of your application than from cron.

If you just need to run an external process with cron, then use cron.

If you need to access internal data structures (copy data from/to a DB, send messages around, trigger events), then use an EJB timer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜