Java batch and managed batch overview

The Java batch function extends the application server to accommodate applications that must perform batch work alongside transactional applications. Batch work might take hours or even days to finish and uses large amounts of memory or processing power while it runs.

An individual request can be completed with seconds of processor time and relatively little memory. Many applications, however, must complete batch work that is computational and resource-intensive.

Liberty supports the following batch features:
  • Java batch

    The batch-1.0 feature enables the use of the JSR-352 programming model.

  • Managed batch
    The batchManagement-1.0 feature provides the following functions:
    • A REST interface for remote job submission
    • The batchManager command-line utility
    • Job logging support
    • Multiple server support by using JMS
Note: The batchManagement-1.0 feature also enables the batch-1.0 feature.

Java batch shutdown and recovery

The Java batch feature behaves differently when the server is shut down while jobs are still running.

Java batch is deactivated when the server is stopped or the Java batch feature is removed. It is also deactivated and reactivated to process a dynamic configuration update. Deactivating Java batch causes stop requests to be issued to all active jobs and messages to be logged for each stop. There is a 2-second period for the jobs to stop. If after 2 seconds there are Java batch jobs that are still running, a message is logged that indicates which job execution IDs are still active. Java batch then shuts down. If jobs are still running after Java batch shuts down, they can experience unpredictable behavior.

Important: If the server is unexpectedly stopped, Java batch recovers by marking all jobs that were running on the server but not completed as FAILED when the server is restarted.