EJB Timer when redepolyed in a cluster environement of Websphere Application Server

若如初见. 提交于 2020-01-04 07:03:27

问题


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


回答1:


EJB timers are not removed when the application is removed. Some options:

  1. Use the WAS_HOME/bin/cancelEJBTimers command to remove them
  2. Add startup logic to your application to cancel/recreate timers as needed.
  3. 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:
    • Creating timers using the EJB timer service for enterprise beans
    • removeAutomaticEJBTimers


来源:https://stackoverflow.com/questions/20217355/ejb-timer-when-redepolyed-in-a-cluster-environement-of-websphere-application-ser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!