Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Java EE Timers are not clustering?

I am working with Java EE EJB timers and Wildfly 8.2.1 server with oracle database.When run a scheduler in my application at cluster environment not working fine,even though selected Transaction Isolation: TRANSACTION_SERIALIZABLE in Wildfly.I am deploying in two nodes it accessing from two node but I need one node only.

In EJB:

@Singleton 
public class TimerSessionBean implements TimerSessionBeanRemote {
@Timeout
    @Schedule(
            hour="11",minute="0",second="00,30"
            )
    public void createTimer(){
        System.out.println("timeoutHandler : "+new Date());
DAO.getInboxDaoImpl().updateStatus();

    }

In DaoImpl:

@Override
    public Boolean updateStatus(String chngCustStus){
        int resVal = 0;

            String sql = "INSERT INTO bonus SELECT ename, job, sal, comm FROM emp
   WHERE comm > sal * 0.25";

        } 
    }

where In Wildfly server: selected as

 Transaction Isolation:  TRANSACTION_SERIALIZABLE
like image 367
Nagaraju Thalluri Avatar asked Apr 20 '26 12:04

Nagaraju Thalluri


1 Answers

Clustered EJB timers are available in WildFly 9 and newer.

Documentation can be found at:

  1. WildFly 9 | EJB3 Clustered Database Timers
  2. WildFly 10 | EJB3 Clustered Database Timers

Most Java EE implementations support this one way or another, but @38leinad is indeed correct that this behaviour is not specified anywhere.

Early versions of JBossAS 7 -> WildFly 8.x missed out because it was a completely new implementation of the specification and the focus was on Java EE 6 and then Java EE 7 compliance.

like image 169
Steve C Avatar answered Apr 23 '26 14:04

Steve C