locked
What is ScopeName for a Change Tracking enabled database? RRS feed

  • Question

  • Hi everyone,

     

    I have been using the sync framework to synchronize a SqlServer database to several SqlCe client databases. I am modifying the code to use v2 so that I can sync client-to-client as shown in the samples included with the SDK.

    My problem is with Scope name. It's a new concept to me. I tried to follow an example to create a scope using DbSyncScopeDescription. Once I finish building the scope description (that contains all of my tables and their columns) I try to apply it using the SqlCeSyncProvisioning object but it throws an error because the Ce database already has Change Tracking enabled.

    Is it possible to continue down the path i'm on without completely changing my database? Is SqlServer change tracking no longer the way to use the Sync Framework?

     

    Thanks for any help,


    -SonnyZ
    Wednesday, April 21, 2010 10:10 PM

Answers

  • Change tracking is currently not supported with Sync Framework Peer to Peer provider.

    To sync SqlServer with other SQL ce databases, you normally provision the server first. Then get the scope description and apply to the ce database. If the Ce database already has the tables defined like the server, you can set the skip option for table creation.

    This step can apply to syncing 2 ce databases as well without the need to have a SqlServer involved. In that case, you first provision a ce database and get the description to apply to second ce database. The skip option is still needed if tables are already existing in second ce db.

    • Proposed as answer by Jandeep Thursday, April 29, 2010 7:00 PM
    • Marked as answer by SonnyZ Thursday, April 29, 2010 8:54 PM
    Thursday, April 22, 2010 6:28 PM
    Answerer

All replies

  • From what I'm reading, this isn't possible at the moment.

    http://social.msdn.microsoft.com/Forums/en-US/uklaunch2007ado.net/thread/0b3e7150-fa76-4c41-97b7-e12d6f3f6713

    Can anyone verify that client-to-client synchronization on change tracking enabled clients is not possible?


    -SonnyZ
    Wednesday, April 21, 2010 10:43 PM
  • try setting SetCreateTrackingTableDefault(DbSyncCreationOption.Skip)
    Wednesday, April 21, 2010 11:12 PM
  • Right before I try to apply, I'm calling:

    SqlCeSyncScopeProvisioning.PopulateFromScopeDescription(DbSyncScopeDescription)

    and

    SqlCeSyncScopeProvisioning.SetCreateTableDefault(DbSyncCreationOption.Skip)

    Is that what you meant?


    -SonnyZ
    Wednesday, April 21, 2010 11:26 PM
  • just before you make a call to Apply.

    SetCreateTableDefault is for the table being synched. SetCreateTrackingTableDefault is for the tracking table.

     

    Wednesday, April 21, 2010 11:35 PM
  • Ohhh I see. So let me get this straight.

     

    I can't sync 2 db cache's (sdf's) that have change tracking enabled. I have to sync the server with an offline cache first, using SetCreateTrackingTableDefault. Then that synchronized CE DB can sync with another CE DB that was also synchronized with the server using SetCreateTrackingTableDefault.

    Is that correct?


    -SonnyZ
    Thursday, April 22, 2010 4:56 PM
  • Change tracking is currently not supported with Sync Framework Peer to Peer provider.

    To sync SqlServer with other SQL ce databases, you normally provision the server first. Then get the scope description and apply to the ce database. If the Ce database already has the tables defined like the server, you can set the skip option for table creation.

    This step can apply to syncing 2 ce databases as well without the need to have a SqlServer involved. In that case, you first provision a ce database and get the description to apply to second ce database. The skip option is still needed if tables are already existing in second ce db.

    • Proposed as answer by Jandeep Thursday, April 29, 2010 7:00 PM
    • Marked as answer by SonnyZ Thursday, April 29, 2010 8:54 PM
    Thursday, April 22, 2010 6:28 PM
    Answerer