Resolved: BATCH-114: Samples broken when input/output sources have step scope
http://opensource.atlassian.com/projects/spring/browse/BATCH-114
This commit is contained in:
@@ -166,9 +166,9 @@ public class SimpleStepExecutor implements StepExecutor {
|
||||
stepExecution.setStartTime(new Timestamp(System.currentTimeMillis()));
|
||||
updateStatus(stepExecutionContext, BatchStatus.STARTED);
|
||||
|
||||
final boolean shouldPersistRestartData = ((AbstractStepConfiguration) configuration).isSaveRestartData();
|
||||
final boolean saveRestartData = ((AbstractStepConfiguration) configuration).isSaveRestartData();
|
||||
|
||||
if (shouldPersistRestartData) {
|
||||
if (saveRestartData) {
|
||||
restoreFromRestartData(module, step.getRestartData());
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ public class SimpleStepExecutor implements StepExecutor {
|
||||
}
|
||||
}
|
||||
|
||||
if (shouldPersistRestartData) {
|
||||
if (saveRestartData) {
|
||||
step.setRestartData(getRestartData(module));
|
||||
jobRepository.update(step);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
</bean>
|
||||
</property>
|
||||
<property name="commitInterval" value="2" />
|
||||
<property name="saveRestartData" value="true"/>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
@@ -40,7 +41,9 @@
|
||||
|
||||
<!-- INFRASTRUCTURE SETUP -->
|
||||
|
||||
<bean id="fileInputTemplate" class="org.springframework.batch.io.file.support.DefaultFlatFileInputSource">
|
||||
<bean id="fileInputTemplate" class="org.springframework.batch.io.file.support.DefaultFlatFileInputSource"
|
||||
scope="step" >
|
||||
<aop:scoped-proxy />
|
||||
<property name="resource" ref="fileLocator" />
|
||||
<property name="tokenizer" ref="fixedFileDescriptor" />
|
||||
</bean>
|
||||
|
||||
Reference in New Issue
Block a user