locked
SqlCeClientSyncProvider Metadata RRS feed

  • Question

  • I am implementing a custom ServerSyncProvider that I hope to pair with the stock SqlCeClientSyncProvider to form a complete N-Tier solution.

     

    I've implemented GetServerInfo and GetSchemaChanges in my server provider but GetChanges and ApplyChanges are stubbed out (i.e. they are NYI).  When I step through my app everything seems to happen has you would expect.  The SyncAgent is able to invoke my WCF service, which in turn invokes my custom ServerSyncProvider.  I see my GetSchemaChanges method getting called, and the return value looks reasonable.

     

    On the client, SqlCeClientSyncProvider takes the schema information and successfully creates a table to store the data that will (eventually) be synchronized.  But I don't see any metadata columns or tombstone tables in my SQL CE database.

     

    At what point and under what conditions does SqlCeClientSyncProvider create the metadata columns/tables?

    • Moved by Tina_Tian Friday, April 22, 2011 6:03 AM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Tuesday, January 6, 2009 5:54 AM

All replies

  • what is the syncDirection in your application ? if it is Snapshot, the metadata on the client side will not be created.

     

    thanks

    Yunwen

     

    Tuesday, January 6, 2009 7:18 PM
    Moderator
  • I'm using bidirectional.

     

    SyncTable myDocumentsSyncTable = new SyncTable("My Documents");

    myDocumentsSyncTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;

    myDocumentsSyncTable.SyncDirection = SyncDirection.Bidirectional;

    myDocumentsSyncTable.SyncGroup = myDocumentsSyncGroup;

    this.Configuration.SyncTables.Add(myDocumentsSyncTable);

     

     

    Wednesday, January 7, 2009 6:04 PM
  • so you have checked the client db and see there is now metadata columns, tables created, right ?

     

    could you check the results of these queries:

     

    select * from information_schema.tables;

    select top (1) * from <the table name>;

     

    thanks

    Yunwen

    Thursday, January 8, 2009 5:15 AM
    Moderator
  • Right, when I look at my “My Documents” table, I see no metadata columns.

     

    Looking at [information_schema.tables], I see this data:

     

    TABLE_CATALOG

    TABLE_SCHEMA

    TABLE_NAME

    TABLE_TYPE

    TABLE_GUID

    DESCRIPTION

    TABLE_PROPID

    DATE_CREATED

    DATE_MODIFIED

    NULL

    NULL

    __sysOCSDeletedRows

    SYSTEM TABLE

    NULL

    NULL

    NULL

    NULL

    NULL

    NULL

    NULL

    __sysOCSTrackedObjects

    SYSTEM TABLE

    NULL

    NULL

    NULL

    NULL

    NULL

    NULL

    NULL

    __sysSyncArticles

    SYSTEM TABLE

    NULL

    NULL

    NULL

    NULL

    NULL

    NULL

    NULL

    __sysSyncSubscriptions

    SYSTEM TABLE

    NULL

    NULL

    NULL

    NULL

    NULL

    NULL

    NULL

    __sysTxCommitSequence

    SYSTEM TABLE

    NULL

    NULL

    NULL

    NULL

    NULL

    NULL

    NULL

    My Documents

    TABLE

    NULL

    NULL

    NULL

    NULL

    NULL

     

     

    Here’s SELECT * FROM [My Documents]:

     

    ID

    Name

    ParentFolder

    MimeTypeID

    CreatedOn

    ModifiedOn

    9e2b90d0-0186-483a-860f-c3a2584c4664

    My File

    264c64d8-e7a5-4572-a2a0-22e37c17e3e1

    1/5/2009 22:29

    1/5/2009 22:29

     

    These are all my columns--I was expecting some metadata columns to be added.

     

     

    Friday, January 9, 2009 5:07 PM
  •  

    is the table existing in the db prior to the sync ? or can you change the TableCreationOption to CreateNewTAbleOrFail to ensure the table was created ?

     

    myDocumentsSyncTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;

     

    thanks

    Yunwen

    Friday, January 9, 2009 11:37 PM
    Moderator
  • The table did not exist prior to the sync (I create a new DB right before the sync happens).  I switched the option to CreateNewTableOrFail and saw the same result--no additional columns added to my table.

     

    What are the names & types of the columns that I should be seeing here?

    Wednesday, January 21, 2009 1:52 AM
  • there should be a couple columns ( __sysChangeTxBsn and __sysInsert TxBsn ) aded to the tracked table.

     

    are you running the query ( select * from yourTable ) from SSMS ? SSMS will hide the system columns so you wont see them.

     

    can you run select * from information_schema.columns, Or to check the columns from the SSMS's UI ( table dedign node ) to see if you have the tracking columns.

     

    thanks

    Yunwen

    Wednesday, January 21, 2009 5:13 AM
    Moderator