From 0333e8cd2f70d9f4cbed3524101a2a0c3918b828 Mon Sep 17 00:00:00 2001 From: dsyer Date: Tue, 26 Feb 2008 09:41:29 +0000 Subject: [PATCH] Incomplete - task 84: Fix samples Infinite loop in stax sample averted by opening the stream only once --- .../batch/execution/step/ItemOrientedStep.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/ItemOrientedStep.java b/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/ItemOrientedStep.java index cac7f6146..ef3150c18 100644 --- a/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/ItemOrientedStep.java +++ b/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/ItemOrientedStep.java @@ -265,6 +265,8 @@ public class ItemOrientedStep extends AbstractStep implements InitializingBean { stepExecution.setExecutionContext(new ExecutionContext()); } + streamManager.open(stepExecution.getExecutionContext()); + status = stepOperations.iterate(new RepeatCallback() { public ExitStatus doInIteration(final RepeatContext context) throws Exception { @@ -277,8 +279,6 @@ public class ItemOrientedStep extends AbstractStep implements InitializingBean { ExitStatus result; - streamManager.open(stepExecution.getExecutionContext()); - TransactionStatus transaction = streamManager.getTransaction(); try {