Results 1 to 2 of 2

Thread: Read an process complete file before write in database

  1. #1
    Join Date
    May 2012
    Posts
    2

    Default Read an process complete file before write in database

    Hi everybody

    I'm new in Spring Framework and i am developing a Batch process where i must read a file (each line is mapped to an Entity Bean), process each line to find errors and persist it on database if no errors found.

    I have been able to read a single line file (FlatFileItemReader), process it, and write in database (JpaItemWriter) with a Chunck-Oriented Step. The problem is that i must read all lines in the file, process them and persist the generated Entities in database if all them are correct.

    I have tried with 3 steps but not succesfully. Is there a way to do this with a chunk? Any idea?

    Thanks for your help and excuse my english

  2. #2
    Join Date
    May 2012
    Posts
    2

    Default

    OK, setting commit-interval a high value reads and process all lines before writing to database. This value seems to indicate the size of the chunk (items procesed), not the number of records inserted before a commit in database.

Posting Permissions

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