0

is there any way to use Rollback the DB operations performed by set of consecutive API's network calls to Help Automation

For instance if i have a test script to test my application so my test script internally will play with my application and calls 3 API's which are going to do changes to DB (Insert, Update, Delete)

so now if my test case fails I want to rollback all the operations performed by it via that 3 APIs

so what's the best way to deal with it either in Front End (Typescript) or Backend (C#)

I am just thinking I can write 2 more APIs in BackEnd such that

  1. One to start transaction so that all the APIs will execute under that transaction
  2. one to either rollback or commit based on that

so that it helps me but the problem is each API is having individual sessions and transactions won't be set so do anyone have any ideas or suggestions on dealing with it

does this create any trouble on the DB like security issues etc?

1 Answer 1

0

The standard approach to rollback changes done through APIs is the Saga pattern. Look at the Typescript Saga example from the temporal.io open source project.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.