Results 1 to 3 of 3

Thread: Spring Batch ItemReader control

  1. #1
    Join Date
    Oct 2011
    Posts
    3

    Default Spring Batch ItemReader control

    Hi,
    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.


    Thanks

  2. #2

    Default

    Hi,
    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

    ticino

  3. #3

    Default

    Quote Originally Posted by Krishna Das View Post
    Hi,
    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.
    What does the reader read, an empty String ?
    What does the writer write in your usecase ?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •