|
[
Permlink
| « Hide
]
Dave Syer added a comment - 15/Feb/08 04:22 AM
It is pretty important that ExecutionAttibutes are stored against the step instance. If the Dao can handle copying the last execution values into the new one, then at that point I agree that StepInstance is redundant. If you can do that, then I am happy to see StepInstance die.
You might not need to persist it, but you will need a new method in the JobRepository (or something). The tricky bit is this: on restart the Step has to restore from the *previous* step execution (not the current one, clearly), so there needs to be a path from the step execution to the previous one if it exists. I think this might be broken at the moment anyway, but if we remove StepInstance, this has to be addressed. Please hold off doing that until I have finished with
Dave,
ExecutionAttributes aren't currently tied to the StepInstance, rather, it's tied to the last execution of a step instance, which *could* be a job instance, assuming you could realiably get the last execution back (which I believe you can). So I would get the last execution via stepExecution.getJobExecution().getJobInstance().getLastStepExecution()? If that works it can be shortened (with some null checks) to stepExecution.getLastExecution(). I am quite happy with that - can you get a comment from Lucas and/or Ben?
Originally my intent was to ask the repository for the last execution - something like repository.getLastStepExecution(jobInstance, stepName). The same can be considered for last job execution and execution counts.
The benefit is it would remove mutual entity references. I guess one could argue this dumbs down the domain classes and shifts towards a 'smart' repository, but the repository has to be smart anyway as it needs to setup the entity references. As long as all classes asking for last executions and execution counts already have reference to repository this approach seems logical. Any opinions on this? |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||