Hi,
you can add one more filed in table where you save transaction id ,field is isProcessed boolean type.
when first time transaction trying to execute(done few task) it check either isprocessed true or false if it false then do nothing else do required task.
but you need to check first how duplicate entry made in table.