We are using rest services (NA Services) to Solve Route and on client side we are using Arcgis javascript api
Now our requirement is that , we have 1 route and we want to store that route and its barrier both for that we have to make 2 database calls using applyEdits method on 2 different layers 1st to store route and 2nd to store barrier
PROBLEM : Now suppose route is saved successfully but some error occurs while saving on of the barrier now as they are not saved is there any option to create transaction that either both are saved or both should rollback. we have seen option in applyEdit rollbackonError but it is valid on single layer only and we have 2 separate layer so how to combine them in single transaction ?
Can anyone Help ?
I faced this issue during building an application using ArcGIS JS API 3.x and after making some search I found the solution:
Read this link first especially the part of example one:
https://developers.arcgis.com/rest/services-reference/enterprise/apply-edits-feature-service-.htm
You will see you can send request with edits as an array and use id for each layer/table in your map service and each layer/table in edits array can be contains adds, updates or deletes
Read else the part of rollbackOnFailure, this parameter will handle what you want.