Answered by:
Can I sync different sets of data at different times on mobile?

Question
-
I have a background thread running every miinute that performs a sync. I am synching 10 download only tables(lookup data) and 4 upload only tables. I would like to be able to constantly sync the 4 upload tables in the background thread and only sync the the download data during a specified action by the user.
So something like when application starts sync both upload and download showing progress to user. Then during background syncs, only upload data is sent. Then user clicks a Sync button to manually sync so to speak, and all tables are synched.
Friday, May 21, 2010 4:02 AM
Answers
-
am assuming right now, you have multiple sync groups (one for each table) but has only one SyncAgent instantiated?
the SyncAgent has a SyncTable collection accessible via its Configuration property (SyncAgent.Configuration.SyncTables).
You cant try removing some tables (e.g., SyncAgent.Configuration.SyncTables.Remove) after instantiating the SyncAgent and before calling Synchronize. This way you don't mess up with the generated codes.
- Proposed as answer by Dong CaoMicrosoft employee Friday, May 21, 2010 7:17 PM
- Marked as answer by gs_ham Monday, May 24, 2010 4:53 PM
Friday, May 21, 2010 3:38 PM
All replies
-
you can create two different sync groups and sync them independently. make sure you run them on separate instances of the syncagent.
Friday, May 21, 2010 4:11 AM -
Thanks JuneT but can you elaborate on that a bit.
My sync agent was generated via the designer. Each table is defined in its own group. I think this is how I want it setup so that if any tables fail within the sync, the sync is not rolled back.
It seems like I could define 2 SyncAgent classes, One with the download tables and one with the upload tables. Then I could instantiate the proper agent at the given time and go from there. The only problem with this would be regenerating via the designer.
Friday, May 21, 2010 1:37 PM -
am assuming right now, you have multiple sync groups (one for each table) but has only one SyncAgent instantiated?
the SyncAgent has a SyncTable collection accessible via its Configuration property (SyncAgent.Configuration.SyncTables).
You cant try removing some tables (e.g., SyncAgent.Configuration.SyncTables.Remove) after instantiating the SyncAgent and before calling Synchronize. This way you don't mess up with the generated codes.
- Proposed as answer by Dong CaoMicrosoft employee Friday, May 21, 2010 7:17 PM
- Marked as answer by gs_ham Monday, May 24, 2010 4:53 PM
Friday, May 21, 2010 3:38 PM