EJB计时器在Websphere Application Server的集群环境中重新分解时 [英] EJB Timer when redepolyed in a cluster environement of Websphere Application Server
问题描述
目前我没有能力创造一个环境来测试这种情况并做出自信的决定,我想知道有没有人面临这样的问题,因为这对我来说是一个非常关键的问题。
谢谢
删除应用程序时,EJB计时器不会被删除。一些选项:
- 使用
WAS_HOME / bin / cancelEJBTimers
命令删除它们 - 将启动逻辑添加到应用程序中以根据需要取消/重新创建计时器。
- 使用自动计时器(
@Schedule
)。在这种情况下,服务器会在应用程序第一次启动时自动创建定时器,并在应用程序卸载时尝试将其删除。有关详细信息,请参阅信息中心:
- 使用企业bean的EJB计时器服务创建计时器
- < a href =http://pic.dhe.ibm.com/infocenter/wasinfo/v8r0/topic/com.ibm.websphere.nd.multiplatform.doc/info/ae/ae/rxml_configuringEJBTimerWorkManager.html =nofollow > removeAutomaticEJBTimers
I have an .ear file which is composed of multiple EJB's and one of them do use a timer service to create timer and the same ejb has the callback method too. That ear is supposed to be deployed in a clustered environment of 3 servers. The issue now is that i want to know what is the expected behavior if i redeployed/undeployed the ear in the cluster. Will the server cancel all timers and clear the persistent scheduler? Or it will preserve them? What are the work arounds?
I have read that in IBM web link: http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=%2Fcom.ibm.websphere.base.doc%2Finfo%2Faes%2Fae%2Frejb_timerservice.html
Currently i don't have the capability to create an environment to test such case and take a confident decision, i wonder if anyone faced such issue before, as this is a very critical issue for me
Thanks
EJB timers are not removed when the application is removed. Some options:
- Use the
WAS_HOME/bin/cancelEJBTimers
command to remove them - Add startup logic to your application to cancel/recreate timers as needed.
- Use automatic timers (
@Schedule
) in 8.0+. In this case, the server automatically creates the timer when the application is first started, and it will attempt to remove them when the application is uninstalled. See the InfoCenter for more information:
这篇关于EJB计时器在Websphere Application Server的集群环境中重新分解时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!