EJB 3.0 Timer Cluster Info
Asked Answered
F

1

1

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...

Finicky answered 4/8, 2011 at 20:52 Comment(0)
D
0

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.

Doviedow answered 8/8, 2011 at 14:33 Comment(1)
Hi,Thanks for the suggestions.We are using our DB table to check the timer instance by creating a tabl.But I would definitely try the getTimers() ways when I have a chance.Finicky

© 2022 - 2024 — McMap. All rights reserved.