BATCH-2500: MultiResourceItemWriter with StaxEventItemWriter restarts at position 0

MultiResourceItemWriter delegating to a StaxEventItemWriter doesn't restart properly.
* Changed the open() method in MultiResourceItemWriter by setting the flag 'opened' to true.

Updated PR with code review comments.
This commit is contained in:
Anne-Lore Montagne
2016-05-12 15:05:16 +02:00
committed by Glenn Renfro
parent ff923e0b8f
commit e2147e2495
4 changed files with 292 additions and 273 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2007 the original author or authors.
* Copyright 2006-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -151,6 +151,7 @@ public class MultiResourceItemWriter<T> extends AbstractItemStreamItemWriter<T>
if (executionContext.containsKey(getExecutionContextKey(CURRENT_RESOURCE_ITEM_COUNT))) {
// It's a restart
delegate.open(executionContext);
opened = true;
}
else {
opened = false;