Batch Job Best Practices

  • when updating many records, flush the Hibernate session frequently to prevent Hibernate from using too much memory and crashing the app (see this thread on the mifos-developer mailing list for more information)
  • If updating a particular record fails, if possible:
    • skip the record
    • provide an error in the log file with essential information about the record
    • move on to the next record
  • Note any records (account ids) that could not be handled successfully in the scheduled_tasks table
  • Use the logger object on the parent getLogger()