-2

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

suresh
  • 3
  • 1
  • 8

1 Answers1

0

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).

Mahmoud Ben Hassine
  • 28,519
  • 3
  • 32
  • 50