Java EE 中的 @Schedule 注释 [英] @Schedule annotation in Java EE
本文介绍了Java EE 中的 @Schedule 注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用以下注释每 5 分钟调用一次无状态会话 bean:
I use the following annotation to call a stateless session bean once a 5 minutes:
@Schedule(second = "0", minute = "0/5", hour = "*")
我按预期工作,但几天后它会自行停止.我想可能有一个默认的生命周期,我不知道如何覆盖它.
I works as expected, except it stops itself after a few days. I guess there may be a default lifetime and I do not know how to override it.
请帮助我将调度程序配置为无限期运行.
Please help me to configure the scheduler to run indefinitely.
推荐答案
在Glassfish下Configuration -> server-config -> EJB-Container -> EJB-Timeservice new property: reschedule-failed-timer = true
In Glassfish under Configuration -> server-config -> EJB-Container -> EJB-Timeservice new property: reschedule-failed-timer = true
这篇关于Java EE 中的 @Schedule 注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文