Oct 11th, 2011, 07:37 PM
Spring Batch ItemReader control
We have a simple scenario where we have to control the execution/ termination of the "ItemWriter" based on the file size of the file used by "FlatFileReader".
We are using the "FlatFileReader" to read from a csv file and "JdbcBatchItemWriter" to write into the oracle database.
Since the writing into the DB is always comparatively expensive, I thought of mitigating the cost of executing the ItemWriter if the file is 0kb.
Please let me know, if spring batch has a solution for this scenario and if it does, please let me know how to configure/ write code to get this done.
Oct 12th, 2011, 02:27 AM
I suppose FlatFileReader don't read anything and don't kick Writer if file ist 0kb (emphy). If not so, just extend the FlatFileReader to ignore 0Kb file
Oct 12th, 2011, 03:47 AM
What does the reader read, an empty String ?
Originally Posted by Krishna Das
What does the writer write in your usecase ?
Tags for this Thread