I am doing a series of work in a wcf service transaction.
1.Making a POST response to a rest api. 2.Processing POST req response and saving it in a db.
Above step 1 and step 2 are happening in a wcf transaction but as a result I have seen an issue where on having an exception step 2 doesn’t get committed but step 1 gets completed creating inconsistencies.
I have seen way out to achieve this through saga pattern or 2PC but couldn’t find any easy implementation or workaround.
PS : I NEED NOT TO ROLLBACK DATA FOR NOW JUST AVOID COMMITTING POST REQ TO REST API. Currently I am handling this by making another patch request to rest api to revert the response received in CATCH BLOCK.