why should I use close method in FlatFileItemWriter in springbatch?

957 views Asked by At

why should I use close method in FlatFileItemWriter in springbatch? or else file date won't be persisted?

1

There are 1 answers

0
Mahmoud Ben Hassine On

Spring Batch will automatically call the open/update/close/write methods when you configure an item writer in a chunk oriented step.

So you don't need to call these lifecycle methods yourself unless you are using the item writer outside the scope of a step, in which case you need manually honour the contract implemented by the item writer (ItemWriter or ItemStreamWriter).