Rotate an instance of the scheduler in a clustered environment

1

I have a EJB project that writes a record to the bank every 5 minutes. For this I am using the @Schedule annotation.

For the cluster to work, I need to upload the application to the two nodes of JBoss (nodeA and nodeB), the scheduler ends up running on both nodes, causing duplicate database registration.

I've researched a lot and still have not found the solution.

I made a very simple project using Quartz , but I ended up giving up because I can not use @PersistenceContext to get entityManager and I also gave up Quartz for now, since I have several applications ready using @Schedule of EJB , then I'll need to migrate all applications to Quartz . If only Quartz resolves, then I will not have any choice.

After all, is there a way to use @Scheduler in the clustered environment by running only one of schedulers of cluster ?

    
asked by anonymous 30.01.2015 / 19:33

0 answers