I have created a function doWork()
that's scheduled to run every day at 1:00 am, the function is as follows:
@Schedule(hour = "1", persistent = false)
public void doWork()
{
System.out.println("Starting .....\nTIME: " + System.currentTimeMillis());
System.out.println("this : " + this);
//Some code here, if-conditions and try/catch blocks. No loops
System.out.println("Exiting .....\nTIME: " + System.currentTimeMillis());
System.out.println("this : " + this);
}
The problem is that this function runs more than once, not as scheduled.
Once I created it, it ran exactly as expected (everyday at 1:00:00 am exactly). A few days later, it started running at 1:03:00 (which doesn't make any sense since it's nonpersistent and there was no downtime in the server anyway). After that the function started running more than once with very short intervals in between (seconds difference)
Does anyone know what might cause this, or tell me what I can do to fix it?
[EDIT]: Environment details
Application Server: WebSphere Application Server 8.5.5
IDE: Rational Application Developer 9.1
Database Management System: IBM DB2 10.1