- This topic has 1 reply, 2 voices, and was last updated 5 years, 9 months ago by .
Viewing 1 reply thread
Viewing 1 reply thread
- You must be logged in to reply to this topic.
Tagged: kbmmw
Hello
Maybe a silly question.
I’m reading different CSV files, line by line creating a client transaction, if the transaction fails, I create a log for the user, my question is what is the proper way to get rid of the failed record(s) ?, because I’ll be sending other transactions from the following line(s) in the CSV file(s) and I don’t want the same failed record(s) to be part of the new transaction.
Sorry for my bad English.
Thanks
Best regards
Job Espejel.
It sounds to me you are doing out of band transactions. Ie. later transactions are kept, but earlier ones should be scrubbed.
The only way to do that is to order your CSV in a way so you do your transactions in band. You can reorder it for example in a memory table.
An alternative is to have an additional boolean field which is named “tentative”. For all records inserted, set it to true. If the following operations are ok, update the record to have tentative false.
Then at the end, delete all records which have tentative true.