Does using the same tables in multiple scopes cause all the data to be transfered multiple times? RRS feed

  • Question

  • Hi

    I've created multiple scopes to try and reduce the time to perform each synchronisation and make my app more responsive, however some tables are required in more than one scope.

    For example, my Users scope syncs the Users and Departments tables before login so that the application knows if the current users has been assigned as a manager for a Department for that day.

    My Departments scope also contains the Departments table as well as some others.

    I noticed that when I first start the application the Users scope causes the whole Departments table to be uploaded and downloaded even though none of the rows have been changed (except by the synchronisation). Then when I sync the Departments scope  the whole departments table is uploaded and downloaded again.

    When I provision the scopes I specify CreateOrUseExisting for stored procedures.

    pv.SetCreateProceduresDefault(DbSyncCreationOption.CreateOrUseExisting); pv.SetCreateProceduresForAdditionalScopeDefault(DbSyncCreationOption.CreateOrUseExisting);

    I think I can re-arrange my scopes so that they don't overlap but I initially didn't want to make them too fine grained as I'm syncing over WCF. (I thought that less connections might would perform better than less but I have not profiled anything, this was just my first attempt).

    Thursday, May 16, 2013 4:12 PM

All replies

  • the sync is done per scope. if a table belongs to more than one scope, each scope is not aware of the changes applied by the other. this may even cause a loop.

    e.g., assuming bidirectional sync.

    scope 1 downloads changes from server

    changes applied by scope 1 on client is detected by scope 2 as changes for upload to server

    scope 2 uploads changes to server

    scope 1 syncs and detects the uploads by scope 2 as changes for download

    you now have a loop

    Friday, May 17, 2013 1:44 PM