Resumable Synchronization API

Resume an interrupted synchronization where partial data has been downloaded to the device.

Syntax

To resume a pending synchronization, call:
[DB resumePendingSynchronization]
 
The application can also determine when to cancel synchronization. For example, you could add logic to the application that sets a max retry resume to cancel the pending synchronization when the application reaches the max setting. The cancel pending synchronization API also unlocks the locked synchronization queue first, but instead of sending a synchronization request, it rolls back any partial data that has already downloaded to the device. To not resume the pending synchronization, call:
[DB cancelPendingSynchronization];
  1. When the system is in a pending synchronization state, waiting for either a resume pending synchronization request by calling resumePendingSynchronization API or a cancellation request by calling cancelPendingSynchronization, the synchronization queue is locked. Any other new blocking or non-blocking synchronization requests are not permitted. Making such a synchronization call raises an exception with the SYNC_QUEUE_FROZEN error code.
  2. If partial data has not downloaded to the device when the interruption occurs, for example, the device is uploading data to the server, or the server is still fetching data from the EIS, the synchronization request terminates immediately and the client reverts to standard behavior. If the interruption is due to:
    • Environmental changes – instead of receiving a SUPSynchronizationStatus_INTERRUPTED_WITH_PARTIAL_DATA status, SUPSynchronizationStatus_ERROR and the exception in the sync context is returned.
    • Application code disables or cancels the synchronization for any reason – a SUPSynchronizationAction_CANCEL status is returned.
  3. The UltraLite® database runs with default isolation of read committed by default. Therefore, when interruption occurs and the application is in pending synchronization mode, the partially downloaded data is not visible to the application until resume synchronization completes the download.

Examples