I have a process that is picking up CSV files and calling a Marketo API to upload records in Marketo.
I am trying to collect some statistics to show each file has how many records and how many were processed and how many had errors. For that I am inserting a DB row with one col as filename and few other stat/information before I send the request and once I get back the response, I am reading the response from API and updating the DB record. Ideally I have to run at least two threads in parallel. My problem is, after I get back response, I am trying to update the existing record based on filename that was part of the DB statistics record, but I don't think I am getting the response sequentially and since filename is not part of response, it is not updating the right record.Any suggestion in this will be helpful.
Attaching my job.