I use an openejb @Resource TimerService
(which injects org.apache.openejb.core.timer.TimerServiceImpl
I think) to set a recurring task to each second.
timerService.createCalendarTimer(new ScheduleExpression()
.hour("*"),
.minute("*"),
.second("1"),
new TimerConfig("timerName",false)
);
Initially, the timeouts occure more or less each second, but with time the reliability deteriorates and after several days the deltas between the calls look someting like that:
delta [seconds] number of occurences
----------------------------------------------
0 18057
1 35084
2 2509
3 4668
4 1869
5 2093
6 632
7 376
8 697
9 93
10 6
11 3
15 2
16 1
18 1
19 1
20 3
22 2
25 2
26 2
31 2
33 1
34 1
38 1
The function called is not blocking, I don't get any "UnableToAquireLock" exceptions.
How can I ensure that not more then two seconds pass between two sequential calls for the function?