All,
We have a BatchManager which contains two static int variables successCount and failCount. This BatchManager represents one job run.
Inside the BatchManager class we offload the tasks to separate threads (dedicated BatchTask
thread class and spawn few threads). From each of these threads we update the shared variables successCount or failCount of the BatchManager class for each batch thread run.
This works well when there is only single request and then sequential request but fails for the concurrent runs scenario. I was looking for a way to have counts per object instance (BatchManager) which leverages multi-threading internally (BatchTask) and have the BatchTask thread increment the BatchManager static variables.
Please let me know your thoughts.
Thanks,