I have a csv file with more than 1 Million records. I want to do some processing on these records and persist all records in DB.
I tried few options like.
Save all entities in one GO
jpaepository.save(entities);
This method takes forever and never compete. works good for smaller no of records.
Save all Entities one by one
entities.forEach(jpaRepository::save);
This method completes but takes hell lot of time and memory usage is on the sky.