locked
Filter and SyncParameter problem on Peer-to-Peer using SyncOrchestrator and DbPeerSyncProvider RRS feed

  • Question

  • Hi,

     

    I am using sync services for ADO.net to sync between two SQL Express 2005 database. After read some document and sample, I begin to use SyncOrchestrator and DbPeerSyncProvider. Everything worked fine before I encounter the last problem: Filtering and sync just part of the data.

     

    I tried to google and search in the Forum, but every solution is talking about using SyncParameter in Configuration property of SyncAgent. However, there is no SyncParameter in Configuration property of SyncOrchestrator. Can some one help me about this?

     

    besides, what's the difference of SyncOrchestrator  and SyncAgent?

    • Moved by Max Wang_1983 Friday, April 22, 2011 6:55 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Monday, July 14, 2008 3:55 PM

Answers

  •  

    Hi ChuanboZhang,

     

    I didn't thought about this approach before, but it may not work well. To consume your SyncParameter, you should have special select query as well. If you do not change your SyncParameter value, it is same as put this value directly in the select query. if you will change the SyncParamter value, some rows will move out of the sync scope from local endpoint and not be synced even there are changes on them. When you switch back to the original SyncParameter value, these changes may not be synced over since remote endpoint may feel that it already knows everything about local endpoint to a much higher knowledge count. You will reach inconsistence from this point.

     

    About your another solution, I cannot see the difference from the first one. If you can share me your commands, I may be able to tell if it will work well or not.

     

    Thanks,
    Dong

    Thursday, July 17, 2008 8:21 PM
    Moderator

All replies

  •  

    If you are using SyncOrchestrator and DbPeerSyncProvider, you cannot use SyncParameter to configure filter. SyncParameter is only used for the v1 offline provider not for the v2 collaboration provider (DbPeerSyncProvider).  The collaboration provider does not support filtering yet. You can try to use where clause in your sqlcommands to implement filter, but move-in and move-out scope scenarios may not work.

     

    SyncOrchestrator provides the Sync method and other sync controls for the DbPeerSyncProvider, and SyncAgent is for syncing the v1 offline provider.

     

    Thanks,
    Dong

    Thursday, July 17, 2008 1:35 AM
    Moderator
  •  

    hi, Dong

     

    thanks for the explaination about the difference for sync agent and SyncOrchestrator.

     

    However, I do find a way to use Sync Parameter to filter. when I use the reflector to view the source code of sync framework, I find there is one class called SyncSession, which has SyncParameter as property. and I found that I could hook to the SyncSelectingChange event to modify the SyncParameter in SyncSession.

     

    I also find another way to solve this filter issue. which is to use the Parameter in the selectchange command, and this works just as what I would expect.

     

    Chuanbo

    Thursday, July 17, 2008 3:28 PM
  •  

    Hi ChuanboZhang,

     

    I didn't thought about this approach before, but it may not work well. To consume your SyncParameter, you should have special select query as well. If you do not change your SyncParameter value, it is same as put this value directly in the select query. if you will change the SyncParamter value, some rows will move out of the sync scope from local endpoint and not be synced even there are changes on them. When you switch back to the original SyncParameter value, these changes may not be synced over since remote endpoint may feel that it already knows everything about local endpoint to a much higher knowledge count. You will reach inconsistence from this point.

     

    About your another solution, I cannot see the difference from the first one. If you can share me your commands, I may be able to tell if it will work well or not.

     

    Thanks,
    Dong

    Thursday, July 17, 2008 8:21 PM
    Moderator