Issue Details (XML | Word | Printable)

Key: BATCH-373
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Robert Kasanicky
Reporter: Adrian Shum
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Spring Batch

jobExecution.getJobInstance().getJob() return null when re-run

Created: 20/Feb/08 04:32 AM   Updated: 07/Aug/08 10:06 AM
Component/s: Core
Affects Version/s: 1.0.0.m4
Fix Version/s: 1.0.0.m5

Time Tracking:
Not Specified


 Description  « Hide
It is found that, if a job is re-run (by passing same JobParameters), the JobExecution created is referring to a JobInstance which refers to null for its Job.
i.e.
JobExecution x = jobLauncher.run(job, jobParam);
x.getJobInstance().getJob(); // returns null

It seems that for re-run job, the Job passed in the JobLauncher is not set to the JobInstance restored from DB.

As I am trying to intercept the Job's execute() by AOP, the only method I can get know of which job being executed is by jobExecution.getJobInstance().getJob()





 All   Comments   Work Log   Change History   FishEye   Builds      Sort Order: Ascending order - Click to sort in descending order
Robert Kasanicky added a comment - 20/Feb/08 06:33 AM
added testcase and fixed the bug

Dave Syer added a comment - 07/Aug/08 10:06 AM
Assume closed as resolved and released