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 = "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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With