I have a map with huge amount of data being populated (around 300,000 records in approx)
and iterating it as below ,
for (Map.Entry<String, List<ClassOBj>> entry : testMap
.entrySet()) {
// send email with map keys as email'id
// email content is populated from the list
// Perform a sql update to the column with the dyanamic value generated here with the email'id
}
As mentioned above , i am worried about the performance issues that will be caused of the above operation that is performed inside the for
loop.
Update:
the scenario is . i am iterating a map which holds large amount of data,
On iterating it i am getting the userid's and i have to make a computation of the user id .For example, consider userid+some constants
and this should be updated in the database table.
and also should be added to the email content along with list values from my map
so i thought batch updates are not possible, am i correct with my understanding ?
should i follow this approach ? or go with any alternate ideas