locked
ScopeProvisioning - Best practice ? RRS feed

  • Question

  • Hello,

    I'm upgrading an older ado sync service solution to SyncFx 2.1 and have some questions regarding scope provisioning.

    Is there any kind of best practice available on how to do this provisioning, in regards of the amount of scope? - by that i mean is it common to make a seperate scope for every single table or go for multiple tables in one scope.

    If there are multiple tables in one scope, how is the transaction handled? - Is the Scope a transaction which is commited when all tables within this scope are finised or is each table commited as soon as transfered successfully to the server or client.

    Thanks

    thomas

     

     

    Thursday, November 10, 2011 5:12 PM

Answers

  • you will have to loop thru the list of your scopes, setting both local and remote provider to a specific scope, calling sync, then moving on again to the next scope
    something like: 
    foreach (var scopeName in scopeList)
    {
    SyncOrchestrator syncOrchestrator = new SyncOrchestrator();
    
    syncOrchestrator.LocalProvider = new SqlCeSyncProvider(scopeName, clientConn);
    
    syncOrchestrator.RemoteProvider = new SqlSyncProvider(scopeName, serverConn);
    
    syncOrchestrator.Direction = SyncDirectionOrder.UploadAndDownload;
    
    SyncOperationStatistics syncStats = syncOrchestrator.Synchronize();
    }
    

     


    • Edited by JuneT Friday, November 11, 2011 9:14 AM
    • Marked as answer by tom54321 Friday, November 11, 2011 3:24 PM
    Friday, November 11, 2011 9:13 AM

All replies

  • have a look at this other thread: http://social.microsoft.com/Forums/br/syncdevdiscussions/thread/0279b1b3-3b28-48c7-9fc8-8ff527971271

    you're right, the transaction is at the sync session/scope level.

    Thursday, November 10, 2011 11:53 PM
  • Thanks,

    Compared to my old sync which is based on ado.net sync services this seems now a lot of more work (if i understand correctly)

    In my current sync solution the Synctables are created and a Syncgroup was assigned (most times one syncgroup per Table). Each Syncgroup/Synctable was than commited individually - which is important for me as we do the sync most times on weak internet connection and so the transaction needs to be as small as possible.

    The difference I see know is, that in my "old" project only one SyncAgent was required who was than performing the sync for all tables.

    Now, If i get this right I would  need one SyncScope per table and one SyncOrchestra for every scope? - right?

    Thomas

     

     

    Friday, November 11, 2011 8:02 AM
  • you will have to loop thru the list of your scopes, setting both local and remote provider to a specific scope, calling sync, then moving on again to the next scope
    something like: 
    foreach (var scopeName in scopeList)
    {
    SyncOrchestrator syncOrchestrator = new SyncOrchestrator();
    
    syncOrchestrator.LocalProvider = new SqlCeSyncProvider(scopeName, clientConn);
    
    syncOrchestrator.RemoteProvider = new SqlSyncProvider(scopeName, serverConn);
    
    syncOrchestrator.Direction = SyncDirectionOrder.UploadAndDownload;
    
    SyncOperationStatistics syncStats = syncOrchestrator.Synchronize();
    }
    

     


    • Edited by JuneT Friday, November 11, 2011 9:14 AM
    • Marked as answer by tom54321 Friday, November 11, 2011 3:24 PM
    Friday, November 11, 2011 9:13 AM
  • All right, .. so i was guessing right ;-)

     

    Thanks

    Friday, November 11, 2011 3:24 PM
  • Thanks! That also answered my question!!!
    Tuesday, November 15, 2011 12:39 AM