I'm facing an issue with saving data to database using a Spring Data JPA repository.
My scenario: I'm using a loop to collect and save data one by one. It takes a lot of time to collect all the data. Therefore I want to save the data for each record immediately into table into the database. I'm using saveAndFlush
method but the data is not being saved into the table immediately.
I cannot wait until all the data is collected because it maybe take a full day to collect all.