img
Table 20-2. Spring Batch Metadata
Category
Table
Description
Job Instance
Every time the job launcher starts a job, a new batch
BATCH_JOB_INSTANCE
job instance will be created, and the execution
information (for example, job name, parameters,
and so on) will be stored in the BATCH_JOB_INSTANCE
table. In the BATCH_JOB_INSTANCE table, there is a
column called JOB_KEY, which is generated based on
the job parameters (for example, file name, date,
and so on) for that specific job instance. One
important concept is that there is a unique
constraint in the BATCH_JOB_INSTANCE table,
composed of the JOB_NAME and JOB_KEY columns.
This means that the job together with the job
parameters should be unique. For the contact
import job, the name of the job is
importContactJob, and the job parameter is the file
name. In this case, for every import contact job, the
file name should be unique. If you try to launch the
job with the same file name, Spring Batch will
complain that a job instance already exists (because
the job parameter was repeated).
The parameters for the job instance will be stored
BATCH_JOB_PARAMS
into the BATCH_JOB_PARAMS table.
Job Execution
The BATCH_JOB_EXECUTION table stores the execution
BATCH_JOB_EXECUTION
information of each job instance. A batch job
instance can have more than one execution (for
example, the first execution was failed, and then was
restarted with success in the second execution).
Stores the batch job execution metadata.
BATCH_JOB_EXECUTION_CONTEXT
Step Execution
Stores the execution information for each step (in
BATCH_STEP_EXECUTION
other words, read, process, write, and custom tasks)
within each job execution.
Stores the step execution meta data.
BATCH_STEP_EXECUTION_CONTEXT
Job Execution Policies
Spring Batch supports a lot of different error handling and execution strategies that can fulfill almost any
enterprise-level batch job requirements. Table 20-3 lists some of the commonly used policies.
Search WWH :
Custom Search
Previous Page
Spring Framework 3 Topic Index
Next Page
Spring Framework 3 Bookmarks
Home