I have a list of 800 Customer objects and each Customer object in loop needs to fetch some additional data from the database, but this single thread operation is taking a lot of time.
My approach is to split the initial list in to multiple lists of 4 and to execute each list in parallel to each other. Can any one come up with a demo code skeleton for my problem statement.
I am confused whether I should write my db queries and business logic inside run() method of Class implementing Runnable interface or any better approach is there?