locked
Synchronization with only part of the store RRS feed

  • Question

  • Hi

     

    I am investigating the Microsoft Sync Framework. In my scenario I have several partners that want to synchronize with the main office but each one of them is allowed to see only part of the data. (each one is allowed to see several rows inside the main table. I can see several rows and another partner is allowed to see other rows inside the same table)

     

    I would like to know if it is possible to tell the sync orchestrator to initiate a synchronization session only on the relevant portion of the data I am allowed to see.

     

    As far I see now: If I am a partner and I send my knowledge I will get back rows I am not allowed to see.

     

    The problem is interesting because the group of rows I am allowed to see is dynamic.

     

    Thanks

     

    Manu

     

    • Moved by Max Wang_1983 Friday, April 22, 2011 5:58 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Tuesday, September 2, 2008 2:23 PM

Answers

  • Hi Manu,

     

     

    As I said in my previous email, filter is not supported by the DbSyncProvider. It means there is no way for you to ask remote side to send a subset of rows of your tables if your SQL select command is not constructed this way. Some people try to modify the Dataset in SyncContext which can be fetched from EventArgs (Such as ApplyingChangesEventArgs) to filter out unwanted rows, but it will cause the mismatch between the SyncKnowledge and the real data in the sync scope. You may not get the correct results after this sync. Unfortunately, there is no good solution for you.

     

    For the partition, if you rows can be grouped to small subsets, and the granularity of these subsets is small enough for your dynamic filter, you can treat each subset as a sync scope and sync them dynamically by keep changing which set of sync scopes will be synced in a particular sync session. For example, if you dynamic filter is based on the US states, you can create one sync scope for each state and set where clause like "State='WA'" for Washington in each SQL selection command of the SyncAdapter. During sync time, you can sync rows of one state or multiple states in your application by invoking sync for each selected sync scope. You can change the sync scope collections in your application everytime to make it dynamic.

     

    Thanks,
    Dong

    Wednesday, September 3, 2008 1:22 AM
    Moderator

All replies

  •  

    Hi Manu,

     

    The DbSyncProvider does not support filter. If it is ok for your scenario to partition the data of the main office into multiple sync scopes, you can let the partner clients to sync a subset of the scope collection based on their security policies. 

     

    Thanks,
    Dong

    Tuesday, September 2, 2008 7:22 PM
    Moderator
  • Hi

     

    The partition must be dynamic so your solution is not practical for me.

    I have no problems with building a provider myself but I could not find a way to tell the SyncOrchestrator that I want to synchronize only a subset of rows from the table so it will forward that info to the provider on the other side.

     

    If you have a solution please tell me

     

    Thanks

     

    Manu

    Tuesday, September 2, 2008 8:22 PM
  • Hi Manu,

     

     

    As I said in my previous email, filter is not supported by the DbSyncProvider. It means there is no way for you to ask remote side to send a subset of rows of your tables if your SQL select command is not constructed this way. Some people try to modify the Dataset in SyncContext which can be fetched from EventArgs (Such as ApplyingChangesEventArgs) to filter out unwanted rows, but it will cause the mismatch between the SyncKnowledge and the real data in the sync scope. You may not get the correct results after this sync. Unfortunately, there is no good solution for you.

     

    For the partition, if you rows can be grouped to small subsets, and the granularity of these subsets is small enough for your dynamic filter, you can treat each subset as a sync scope and sync them dynamically by keep changing which set of sync scopes will be synced in a particular sync session. For example, if you dynamic filter is based on the US states, you can create one sync scope for each state and set where clause like "State='WA'" for Washington in each SQL selection command of the SyncAdapter. During sync time, you can sync rows of one state or multiple states in your application by invoking sync for each selected sync scope. You can change the sync scope collections in your application everytime to make it dynamic.

     

    Thanks,
    Dong

    Wednesday, September 3, 2008 1:22 AM
    Moderator