This is a classic race condition. You either need to change the processing to serial, or you need to specifically handle this error.
In your processing, after checking whether or not to do an insert or update, if the insert fails, you check to see if it is because unique constraint violation. If so, then you determine how you want to handle the situation.
Two records with the same ID presumably are not the same. If they are the same, the failed insert can be ignored – the DB already has the data.
If they are not the same do you have a way to determine which is newer? Then you can decide whether to continue with the “failed” record and do an update, or ignore it as “superceded.”
#Integration-Server-and-ESB#B2B-Integration#webMethods