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
Clustered EJB timers are available in WildFly 9 and newer.
Documentation can be found at:
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.
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