Reset page and item count on RepositoryItemReader#close()
When closing the RepositoryItemReader, this commit now resets the current item index and page index to be 0 so that it can be reused imediately (instead of requiring the reader be step scoped for the reset to occur). BATCH-2365
This commit is contained in:
@@ -216,6 +216,11 @@ public class RepositoryItemReader<T> extends AbstractItemCountingItemStreamItemR
|
||||
|
||||
@Override
|
||||
protected void doClose() throws Exception {
|
||||
synchronized (lock) {
|
||||
current = 0;
|
||||
page = 0;
|
||||
results = null;
|
||||
}
|
||||
}
|
||||
|
||||
private Sort convertToSort(Map<String, Sort.Direction> sorts) {
|
||||
|
||||
Reference in New Issue
Block a user