Java Reference
In-Depth Information
BATCH_JOB_INSTANCE
BATCH_JOB_PARAMS
BATCH_JOB_EXECUTION
BATCH_JOB_EXECUTION_CONTEXT
BATCH_STEP_EXECUTION
BATCH_STEP_EXECUTION_CONTEXT
BATCH_JOB_INSTANCE
Let's start with the BATCH_JOB_INSTANCE table. As you saw earlier, a job instance is created when the
job is created. It's like calling a new on a job. However, a job instance is really the combination of the job
instance itself and the job parameters (as stored in the BATCH_JOB_PARAMS table). This combination
can only be executed once to success. Let me say that again: a job can only be run once with the same
parameters. I won't pull out the soapbox on why I don't like this feature, but I will say that it's common
to pass in the date and time of the run as job parameters to get around this. After running your
HelloWorld job, the BATCH_JOB_INSTANCE table looks like what is shown in Table 2-3.
Table 2-3. BATCH_JOB_INSTANCE Table
Field
Description
Value
JOB_INSTANCE_ID
Primary key of the table
1
The version 5 for the record
VERSION
0
JOB_NAME
The name of the job executed
helloWorldJob
JOB_KEY
A hash of the job name and
parameters used to uniquely identify
a job instance
d41d8cd98f00b204e980098ecf8427e
BATCH_JOB_PARAMS
It should come as no surprise that the BATCH_JOB_PARAMS table contains all the parameters passed to
the job. As mentioned in the previous section, the parameters are part of what Spring Batch uses to
identify the run of a job. In this case, the BATCH_JOB_PARAMS table is empty because you didn't pass
any parameters to your job. However, the fields in the BATCH_JOB_PARAMS table are shown in Table 2-
4.
5 To learn more about the versions and entities in domain-driven design, read Domain Driven Design by
Eric Evans (Addison-Wesley, 2003).
 
 
Search WWH ::




Custom Search