Ask questions and see you at March, 13th, 6.PM. CET: http://www.ustream.tv/channel/adambien
Also checkout recent episode:
Please keep the questions Java EE-stic. Means: as short and as concise as only possible. Feel free to ask several, shorter questions.
Hi Adam,
I recognized that a programmatic EJB Timer in a Payara Cluster (4.1.2) runs on both nodes, even if the timer is persistent
@startup
@Scheduler
........
@PostConstruct
public void initialize() {
final ScheduleExpression expression = new ScheduleExpression();
expression.minute(tokens[0]).hour(tokens[1]).dayOfWeek(tokens[2]).dayOfMonth(tokens[3]).month(tokens[4]);
final TimerConfig tf = new TimerConfig();
tf.setPersistent(true);//must be true because of cluster, only one node should execute this code
timerService.createCalendarTimer(expression, tf);
EJB_TimerTable
The table shows that the LASTEXPIRATIONRAW is exactly the same time for node1 and node2. (By the way: What means the server row) The log files of the nodes confirms that the timerjob was runnig on both nodes.
I would expect that persistent timers are running only on one node
Thanks in advance,
Michael