Sagar Kulkarni
Sagar Kulkarni

Reputation: 686

Azure Mobile Service offline syncing behavior with relational database using .NET backend

Delivery Table contains status updates;

Based on Delivery Status update, we have triggered to insert items into another system.

  1. From my mobile application I am inserting DeliveryItems first (offline),
  2. and then updating Delivery Staus (offline).
  3. Now when I am syncing with Azure mobile service. Delivery record getting updated before completing insertion of all items.

I want insert/update/delete to be done sequentially, how do I achieve this?

Upvotes: 0

Views: 174

Answers (2)

phillipv
phillipv

Reputation: 1717

Its not currently possible to guarantee order for two main reasons:

  • An error in inserting delivery item 2, will not inherently stop the attempt to insert delivery item 3. (You can address this via a Handler)

  • Multiple actions taken on the same item are combined (So an offline insert, and update will go as one Insert to the server when you come online)

If it's the first case that is tripping you up, you can have the sync handler abort the sync (so items 3, 4, .. and the Delivery don't go up)

Handling the second case is more complex, with the simplest (but maybe unreasonable) approach is don't edit the Delivery until after you have inserted/edited all the items.

Upvotes: 0

Ansary Ans21
Ansary Ans21

Reputation: 462

That's based on your sync order.If you want to sync delivery items first, place the sync for "sync delivery items" above "delivery".

Upvotes: 0

Related Questions