Can you share your code?
Can you change your code to generate the sequence numbers inside the transactions? Will you still get the duplicates but with the unique DBTASKID()?