[jsr352-public] Is ItemWriter called in case of empty output data list?
- From: Cheng Fang <
- Subject: [jsr352-public] Is ItemWriter called in case of empty output data list?
- Date: Wed, 26 Feb 2014 15:14:04 -0500
During a chunk processing, the output data list for a chunk can be
empty. This can happen if all of the data read so far have been
filtered out by the ItemProcessor, resulting in an empty output list.
In this case, should the batch runtime still call ItemWriter and
An empty output can also happen when the ItemReader read 0 items. For
example, given 30 items, and item-count of 10, the first 3 chunks would
deplete all input and the 4th chunk reads 0. When the 4th chunk is
committed, should the ItemWriter.writeItems method be called?
Some tck tests seem to expect ItemWriter not called:
ChunkTests line 484 expects a job exit status "buffer size = 10", which
is set by the writer in chunk 1, 2 &3, but if it is invoked for the 4th
chunk (empty chunk), the job exit status would be "buffer size = 0".
What do you think?