I have a scenario where I have to load a large chunk of Flat-File data into H2 database using SpringBatch. I have used a CustomReader and JdbcBatchItemWriter for this. After loading I found that there are duplicate rows in the database only while loading large size data(millions).
By reducing the commit-interval value ,there has been a decrease in the duplicates.But this is not an optimal solution as there would be an impact on performance by doing so.
Using a unique key while loading also seems to solve the problem but we are not allowed to alter the table structures as per the requirement.
Any other solution would be very helpful.
Thanks