after a failed transaction how to get rid of the records

Home Forums kbmMW after a failed transaction how to get rid of the records

Tagged: 

Viewing 1 reply thread
  • Author
    Posts
    • #54791
      jet2050
      Participant

      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.

       

    • #54811
      kimbomadsen
      Keymaster

      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.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.