Hi Max
your posted code is little strange:
why do you insert the COMMIT in a do cycle?
I don't know if the COMMIT and WAIT can halp you, because (I suppose) you don't have any saving proccess running in update task,
So only the COMMIT should be enough.
I don't believe the problema is here, probably yuo have a problem with duplicated key, but I can't be sure without to see how you save the data.
Max