3

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
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555

2 Answers2

1

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.

Steve C
  • 18,876
  • 5
  • 34
  • 37
0

This is indeed the expected behaviour.

There is no notion of a cluster in the Java EE spec. So, there is no portable solution. On JBoss i haved in the past used the Quartz timer. Specifically for Wildfly 8, have a check if this post answers you question.

38leinad
  • 196
  • 2
  • 11