Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

With MS Sync Framework 2.0, how can I best handle related tables?

Sync Framework synchronizes data on a table-by-table basis, but my entities are normalized across sets of related parent-child tables. This creates problems for my application where a parent row might appear on the server to be processed, but the child rows might not appear for a few seconds. If there is a connection problem between my client app and the server, the child rows might not appear for some time.

How can I design my application to handle child tables being synced separately from the parent tables?

The specific scenario I'm looking at is receiving work orders on a server from a backend system to be distributed to engineers in the field using tablet PCs or PDAs. These work orders are large, complex entities that might cover half a dozen tables. The engineers complete their work, syncs the results, and the server returns the completed work order to the backend system.

A few of my own ideas so far are posted below.

like image 409
Rory MacLeod Avatar asked Nov 05 '22 16:11

Rory MacLeod


1 Answers

Using the Sync Framework, Add the related tables into their own Sync Groups. E.g. Add OrderHeader and OrderDetail tables to their own sync group called Orders.

Dont put anything else in a sync group unless its directly related.

Then Sync each of the sync groups in a transaction. That way you are guaranteed to get both or none of the tables synchronised...

Please ask if you require more detail on this process.

like image 183
JohnnyJP Avatar answered Nov 14 '22 21:11

JohnnyJP