Skip to content


Offline applications should be designed with ability to handle any errors and conflicts.

Offline OData Errors

Offline OData errors generally fall into the following categories:

  • Network errors Occur when communication with the server is interrupted during an upload or download operation.

    You can often resolve network errors by retrying the operation at a later time. However, if network errors occur due to server-side application configuration, ensure that you have specified the correct settings.

  • Contract violation errors Occur when the application attempts to perform an invalid operation, such as sending a malformed request or attempting to call API methods without first opening the offline store. Such operations are rejected by offline store, and therefore don't impact the store; however, the application should handle the operations in a way that they can be corrected.

  • Business logic failures Occur if business logic at the OData service prevents a change that is allowed at the offline store. The error is recorded in the ErrorArchive, an Offline OData specific entity set containing detailed information about errors. The application can obtain the body of the original request from ErrorArchive.

Offline OData Conflicts

Conflicts are specific types of errors that arise when multiple clients simultaneously modify the same data in the back end. An offline application should include a process that either avoids conflicts, or logs and resolves them when they arise.

OData services use ETags to identify conflicts. An ETag is an identifier that is assigned to a specific version of an entity. When an entity is modified, a new ETag is assigned.

To use ETags to detect conflicts in your application:

  • The application retrieves an entity, along with its ETag, from the offline store.

  • When an update request is made, the application sends the request, along with the original ETag, to the offline store. `

  • If the ETag that is provided with the update request matches what is currently in the offline store, the update is performed locally and a new ETag is generated. The request and the ETag are added to the request queue. If the ETag does not match, an error is generated.

  • When an upload is performed, the request and the ETag are sent to the OData service. If the ETag matches the one in the OData service, the update is performed and the updated entity plus a new ETag are retrieved by the application during the next download. If the ETag does not match, the request will fail, the error is put in the ErrorArchive and the application then determines how to proceed.

Usually when an update results in an ETag conflict, the offline store may need to present the latest state from the back end with the modified state so that the application can decide whether additional changes are necessary. A download, possibly with a limited set of defining queries, might need to be done. When the download completes, the offline store has the latest ETag and data. From the offline store, the application can only see the latest state from the back end with the associated pending requests applied. If you require the latest state from the back end for proper handling of the conflict, you may choose to remove entries in the ErrorArchive. This will cause removal of all requests in error as well and associated entities returning to server state. This will be discussed further in Handling Failed Requests.

Last update: April 14, 2021