RollbackOnFailure and sync models
Sync models
The sync model defines how layers can be synced. When creating a replica, clients can choose one of the following sync models by setting the syncModel parameter:
- perReplica—Layers within a replica cannot be synchronized independently. Each synchronizeReplica operation applies to all the layers in the replica.
- perLayer—Layers within a replica can be synchronized independently. A chosen subset of the layers within a replica can be synchronized when running the synchronizeReplica operation.
The feature server’s syncCapabilities property describes the supported sync models.
"syncCapabilities": {
"supportsPerLayerSync": true,
"supportsPerReplicaSync": true,
…
}
For example, if supportsPerLayerSync is true and supportsPerReplicaSync is false, you can choose only a perLayer sync model when running the create replica operation.
If supportsPerLayerSync is not provided, it's false by default.
If supportsPerReplicaSync is not provided, it's true by default.
RollbackOnFailure
When synchronizing, clients can set the rollbackOnFailure parameter. RollbackOnFailure determines the behavior when there are errors while importing edits on the server during synchronization. This only applies in cases where clients are uploading edits to the server.
RollbackOnFailure can be set as follows:
- rollbackOnFailure = true—If an error occurs while importing edits on the server, all edits are rolled back (not applied), and the operation returns an error in the response. Use this setting when the edits are such that you either want all or none applied.
- rollbackOnFailure = false—If an error occurs while importing an edit on the server, the import process skips the edit and continues. All edits that were skipped are returned in the edits results with information describing why the edits were skipped.
The feature server’s syncCapabilities property determines if the synchronizeReplica operations rollbackOnFailure parameter is supported.
"syncCapabilities": {
"supportsRollbackOnFailure", <true | false>
…
},
If the supportsRollbackOnFailure property is true, you can set the rollbackOnFailure parameter to true or false when running the synchronizeReplica operation.
If the supportsRollbackOnFailure property is false, the synchronizeReplica operation does not support the parameter.
When supportsRollbackOnFailure is false and only a perLayer sync model is supported ("supportsPerLayerSync":true and "supportsPerReplicaSync": false), synchronizeReplica always applies the rollbackOnFailure = false behavior above.
When supportsRollbackOnFailure is false and only a perReplica sync model is supported ("supportsPerLayerSync": false and "supportsPerReplicaSync": true), synchronizeReplica always applies the rollbackOnFailure = true behavior above.
For information on how to handle errors during sync, see Error handling with sync operations.
Supported rollbackOnFailure behavior and sync models
The following table lists the supported syncModels and rollbackOnFailure behavior with ArcGIS Server:
Data source | rollbackOnFailure=True | rollbackOnFailure=False | PerLayer syncModel |
PerReplica syncModel |
---|---|---|---|---|
Non-versioned data | No | Yes | Yes |
No |
Versioned data | Yes | No | No | Yes |