Here's an observation gleaned while reviewing batch jobs. Not sure how significant it is. If they are significant, we should log issues for them.
When MifOS is started up, the class MifosScheduler invokes java.util.Timer.schedule(a task class, initial date, delay time) for each batch task, which schedules each task to run the first time at the initial date (currently 24:00:00 for all tasks -- see tasks.xml) and schedules the task to re-run after the specified delay time (from the time the task started running). There are two potential issues with this: 1. If the task is delayed, the next run will also be delayed. If this happens repeatedly, the start times will drift later and later, possibly causing a very early AM user to see stale data. Alternatively, the Scheduler could invoke java.util.Timer.scheduleAtFixedRate(task class, initial date, delay time), which guarantees that tasks will run exactly at midnight. The risk is, if a task is delayed for much of a day, say 22 hours, it would run twice in rapid succession, once at 10 PM and a second time at midnight. If the task is not idempotent this may result in incorrect data. 2. If the Mifos application is shut down before midnight and not restarted until after midnight, the batch jobs will not run at all, until the next evening. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
