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