RESOLVED - issue BATCH-511: read failures cause rollback

Renamed "commit*" in StepContribution to "combine*".  Fixed broken test (forgot to combine skip counts).
This commit is contained in:
dsyer
2008-03-27 10:48:04 +00:00
parent e46c972d8e
commit d983eba1c5
5 changed files with 17 additions and 8 deletions

View File

@@ -101,13 +101,20 @@ public class StepContribution {
* Increment the counter for skipped reads
*/
public void incrementReadSkipCount() {
this.readSkipCount++;
readSkipCount++;
}
/**
* Clear the read skips and transfer them to the total skip count
* @return the read skip count
*/
public void commitReadSkipCount() {
public int getReadSkipCount() {
return readSkipCount;
}
/**
* Combine the skip counts and reset read skips to zero.
*/
public void combineSkipCounts() {
skipCount += readSkipCount;
readSkipCount = 0;
}

View File

@@ -304,9 +304,8 @@ public class StepExecution extends Entity {
*/
public synchronized void apply(StepContribution contribution) {
itemCount += contribution.getItemCount();
// TODO: this should not be necessary - the step decides
// executionContext = contribution.getExecutionContext();
commitCount += contribution.getCommitCount();
contribution.combineSkipCounts();
skipCount += contribution.getSkipCount();
}

View File

@@ -299,7 +299,6 @@ public class ItemOrientedStep extends AbstractStep {
Thread.currentThread().interrupt();
}
contribution.commitReadSkipCount();
// Apply the contribution to the step
// only if chunk was successful
stepExecution.apply(contribution);

View File

@@ -173,7 +173,7 @@ public class ItemSkipPolicyItemHandler extends SimpleItemHandler {
catch (SkipLimitExceededException ex) {
// we are headed for a abnormal ending so bake in the skip
// count
contribution.commitReadSkipCount();
contribution.combineSkipCounts();
throw ex;
}
}