How to call multiple services/APIs in one transaction boundary?

Technote (FAQ)


Question

In certain scenarios, the implementation requires that while calling a set of services/APIs the DB commit should not happen after each API or service execution. The data should be committed once all the executions have been completed successfully.



For example, one such flow could be

Execute service1.

Execute API.

Execute service2.



Requirement here is to commit the result to DB together after the entire flow is finished successfully rather than after each execution.

Answer

This can be achieved by calling the services/APIs in a multiApi.  The multiApi API is used to call multiple APIs from a single API invocation. It makes sure that data is committed to the DB only after all the executions are successful. This wrapper API ensures that all the APIs/services within a invocation reside in the same commitment boundary. This permits a set of work to be submitted as a unit; either all the work, as represented by the API calls, succeeds or fails. If any individual API throws an exception, the multiApi API throws an exception, and the work done so far is rolled back.

Rate this page:

(0 users)Average rating

Document information


More support for:

Sterling Order Management

Software version:

9.0, 9.1, 9.2

Operating system(s):

AIX, HP-UX, Linux, Solaris, Windows

Reference #:

1632893

Modified date:

2013-03-31

Translate my page

Machine Translation

Content navigation