Java Reference
In-Depth Information
Table 2-4. BATCH_JOB_PARAMS Table
Field
Description
JOB_INSTANCE_ID
Foreign key to the BATCH_JOB_INSTANCE table
TYPE_CD
The type of value being stored (string, date, long, or double)
KEY_NAME
The parameter key (job parameters are passed in as key/value pairs)
STRING_VAL
The value, if the type of parameter was a string
DATE_VAL
Date parameters
LONG_VAL
Long parameters
DOUBLE_VAL
Double or float parameters
BATCH_JOB_EXECUTION and BATCH_STEP_EXECUTION
After a job instance is created, it's executed. The state of the job execution is maintained in—you
guessed it—the BATCH_JOB_EXECUTION table. Start time, end time, and results of the last execution
are stored here. I know what you're thinking: if a job with the same parameters can be run only once,
what's the point of the BATCH_JOB_EXECUTION table? The combination of job and parameters can
only be run once to success. If a job runs and fails (assuming it's configured to be able to be rerun), it can
be run again as many times as needed to get it to succeed. This is a common occurrence in the batch
world when dealing with data that's out of your control. As the job processes data, it can find bad data
that causes the process to throw an error. Someone fixes the data and restarts the job.
The BATCH_STEP_EXECUTION table serves the same purpose as the BATCH_JOB_EXECUTION
table. Start time, end time, number of commits, and other parameters related to the state of the step are
maintained in BATCH_STEP_EXECUTION.
After the execution of the HelloWorld job, you have a single record in the BATCH_JOB_EXECUTION
table. Notice in Table 2-5 that the times are all the same: it's because System.out.println(HELLO_WORLD);
doesn't take long.
Table 2-5. BATCH_JOB_EXECUTION Table
Field
Description
Value
JOB_EXECUTION_ID
Primary key of the table
1
VERSION
The version of the record
2
JOB_INSTANCE_ID
Foreign key to the BATCH_JOB_INSTANCE table
1
CREATE_TIME
The time the job execution was created
2010-10-25 18:08:30
START_TIME
The start time for the job execution
2010-10-25 18:08:30
END_TIME
The end time for the execution, regardless of
success
2010-10-25 18:08:30
STATUS
The status as returned to the job
COMPLETED
EXIT_CODE
The exit code as returned to the job
COMPLETED
EXIT_MESSAGE Any exit message that was returned to the job
LAST_UPDATED The last time this record was updated 2010-10-25 18:08:30
Your BATCH_STEP_EXECUTION table also contains only one record because your job had only one
step. Table 2-6 outlines the columns and values that the table has after your execution.
 
 
Search WWH ::




Custom Search