开发者

Disabling EJB Timer (GlassFish 3.1, Java EE 6)

We have a VIP (BIG-IP) that actually moves the web service requests to two nodes each with its own GlassFish server 3.1 and our services deployed. So it is not a true glassfish cluster. My problem is that I have a lot of Scheduler services like the one listed below:

@Schedule(minute = "55", hour = 开发者_Python百科"23", dayOfWeek = "Wed")
public void runScheduledMedicaidPaymentProcess() {

Is there a way for me to disable the EJB Timer Service on one node so that the above method is not run on both nodes when it is 11:55 pm on Wednesday?

I did see the use of _Default pool for Clusters mentioned in Glassfish server document, but as I explained before ours is not a true cluster. Please let me know if there is any way to stop the timer on one so that it is not activated.


If you're not using a cluster then you really just have two independent instances. You're going to have to create some sort of semaphore that each method checks (a db column might be a good solution). The method would return whether or not it's okay to run the timer. Each of your instances would call the method but only one instance would end up running the timer.

Or...

Setup a cluster.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜