locked
schema-change propagation to client data store (SQLce) ? RRS feed

  • Question

  • Hi All,

    My application is the hub-and-spoke with SQLserver as central DB and SQLce as client datastore; I am currently using Sync FXV2.0 and with SqlCeSyncProvider as clientDB provider.

                SqlCeSyncProvider provider = new SqlCeSyncProvider

                {

                    Connection = new SqlCeConnection(sqlceConnStr),

                    ScopeName = scopeName,

                    BatchingDirectory = sourceBatchingDirectory,

                    MemoryDataCacheSize = batchSize

                };

     

    However, I am trying to implement the schema change on the client sdf after the initial deployment; 

     

    http://msdn.microsoft.com/en-us/library/bb726009.aspx

    the sample code is using SqlCeClientSyncProvider() which provides 2 events that i am looking for. however, i am not sure how could Batching could be done with SqlCeClientSyncProvider()? 

     

    If that is the limitation for SqlCeClientSyncProvider, any suggestion of performing schema change to the client after the initial deployment?

    I read couple of posts saying schema-change propagation has not much supported with Sync FX; I just want to see what would be the best strategy available now?

     

    Many thanks,

    --alex

    Tuesday, October 5, 2010 8:14 PM

Answers

  • Hi JuneT,

     

    thanks for your feedback

    Actually in my application, we are using snapshot creation and batching.

    I will try to the following 

    1) create a custom-upgrade method that check for the current SQLce version installed (maybe using a basic table for version checking); It will be called right after the snapshot is created. If so, then perform the updates accordingly by executing the (manual pre-populated script file).

    2) actually, not only for new schema-change but also the script for creating constraints (Foreign Key, default) and indexes. the goal is to put more checkings in the SQLce side in order to minimize the data-integrity related error while sync-ing. 

    thanks again,

    --alex

     

    Wednesday, October 6, 2010 6:26 PM

All replies

  • hi alex,

    you're right, Sync Fx doesnt automatically handle schema changes. 

    the offline providers (SqlCeClientSyncProvider and DbServerSyncProvider) doesnt automatically handle batching either. you can implement the batching on the server side by modifying the query/sp for retrieving the new anchor, but you cant alter the query on the SqlCe side though.

    Wednesday, October 6, 2010 2:38 PM
  • Hi JuneT,

     

    thanks for your feedback

    Actually in my application, we are using snapshot creation and batching.

    I will try to the following 

    1) create a custom-upgrade method that check for the current SQLce version installed (maybe using a basic table for version checking); It will be called right after the snapshot is created. If so, then perform the updates accordingly by executing the (manual pre-populated script file).

    2) actually, not only for new schema-change but also the script for creating constraints (Foreign Key, default) and indexes. the goal is to put more checkings in the SQLce side in order to minimize the data-integrity related error while sync-ing. 

    thanks again,

    --alex

     

    Wednesday, October 6, 2010 6:26 PM
  • the other area you will have to address is how to modify the scope definition to add/remove columns. the Sync Fx API doesnt have an interface to alter the scope definition, so you will have to address altering the Sync Fx database objects to add/remove columns.

    Wednesday, October 6, 2010 11:26 PM