Announcement Announcement Module
No announcement yet.
Read an process complete file before write in database Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

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