EJB 3.0 Timer Cluster Info

我的梦境 提交于 2020-01-05 07:25:11

问题


I was able to get some hands on EJB3.0 Timer Service.I was able to get the timeout working and I was able to invoke the timer using servlet Context listener.I have deployed a simple app which sends alerts at a specific interval.I am using WL 10.3.1(does not support EJB3.1,to use Scheduler). I get alerts twice at the same time.(I have a cluster with 2 managed Servers).I looked at few examples of using a timer in WL cluster,for eg: http://shaoxiongyang.blogspot.com/2010/10/how-to-use-ejb-3-timer-in-weblogic-10.html .But I would like to avoid any configuration on the server.Is there any other way this can be controlled in a Cluster Env.I want to have one timer running at any time in a cluster Env.

Thanks...


回答1:


Do the servlet context listeners unconditionally create the timer during contextInitialized? If so, that explains the problem since the servlet context listener will run in each JVM. You'll need to somehow check if the timer has already been created first. Either use getTimers or check/insert a row into your own database table.



来源:https://stackoverflow.com/questions/6948360/ejb-3-0-timer-cluster-info

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