ApplyEdits RollbackOnFailure

606
0
02-12-2018 05:04 PM
Trippetoe
Occasional Contributor III

I am using the REST API method 'ApplyEdits' at the feature service level (version 10.4). I am trying to apply edits to multiple layers of the feature service in a single call. I am setting the 'rollbackOnFailure' parameter to true, and each layer in the feature service supports rollbackOnFailure.

My reading of the REST API documentation is that if any of the edits fail, all the edits will fail:

Description: Optional parameter to specify if the edits should be applied only if all submitted edits succeed. If false, the server will apply the edits that succeed even if some of the submitted edits fail. If true, the server will apply the edits only if all edits succeed.

However, that is not the behavior i seeing. I have examples where edits on layer id 0 fail, but edits on layer id 1 succeed.  Here is a typical response for the situation:

[
 {
 "id": 0,
 "addResults": [
 {
 "success": false,
 "error": {
 "code": 1020,
 "description": "GlobalId field is missing."
 }
 }
 ],
 "attachments": {
 "addResults": [
 ],
 "deleteResults": [
 ],
 "updateResults": [
 ]
 }
 },
 {
 "id": 1,
 "addResults": [
 {
 "objectId": 803,
 "globalId": "{017b1b27-25b5-4e0a-9030-102224bc5601}",
 "success": true
 }
 ]
 }
]

Is there a bug in the system or with my reading comprehension? Is there some other setting that i need to set.

We need an 'atomic' edit operation because the service has related data and we want to avoid situations where only some pieces of the data get submitted successfully. In the example above the 'related' data were successfully submitted but the origin/parent data were not. Now we are stuck with orphan data in the related table. 

Thank you.

0 Kudos
0 Replies