DB Transaction RollBack in Iteration

Hi,

I’m trying to write few records into DB using loops, in each iteration a record will be inserted into the DB table.

If I use the DB transaction nodes inside the loop (as shown above), I’m able to run the workflow but in this above scenario for each iteration a new transaction is started.

But the requirement is that I need all the iteration in a single DB transaction as below,

For example - if the first iteration is successful and the second iteration is a failure it is expected to roll back the first iteration (successful run) data which is pushed into the DB.

Please advise on this as I’m getting loop errors If I try to have all the iterations inside a single DB transaction

Thanks in advance.