locked
Example/Instructions for creating custom ServerSyncProvider RRS feed

  • Question

  • Hello,

     

    I'm in need of a ServerSyncProvider that will work with SSCE.  From other threads, it sounds like that capability may be provided in a future release.  In the mean time, I'd like to develop my own ServerSyncProvider that is compatible with SSCE.

     

    I've attempted to use DbServerSyncProvider, but when I assign a SqlCeCommand object to my DbServerSyncProvider object, I get the following error:  "Invalid connection object. Unable to create a new instance of the connection object."   I then tried to use OleDb against my SSCE database.  The connection works fine, but I get errors when setting up parameters on the commands.

     

    Can you provide a pointer to an example or documentation on creating a custom ServerSyncProvider?  I've read through the books online material and studied the class metadata.  However, I'm not sure if there is enough information there to construct a custom provider.

     

    Larry

    • Moved by Max Wang_1983 Friday, April 22, 2011 8:27 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Tuesday, June 5, 2007 7:06 AM

Answers

  • to Impl your own server provider, you need to create an object basd on the ServerProvider object and implement the virtual methds. just trying to switch the existing dbserverprovider to SSCE won't work.

     

    we currently don't have documents for a sample server providers unfortunately.

     

    thanks

    yunwen

    Tuesday, June 5, 2007 4:40 PM
    Moderator

All replies

  • to Impl your own server provider, you need to create an object basd on the ServerProvider object and implement the virtual methds. just trying to switch the existing dbserverprovider to SSCE won't work.

     

    we currently don't have documents for a sample server providers unfortunately.

     

    thanks

    yunwen

    Tuesday, June 5, 2007 4:40 PM
    Moderator
  • Thank you, Yunwen.  I'll attempt to implement the virtual methods.  The part I'm unclear about is exactly what needs to be done for each method to fulfill the interface.

     

    I'm curious why the DbServerSyncProvider won't work with SSCE.  It seems the SSCE classes implement the required interfaces (IDbConnection, IDbCommand, etc.).  Can you provide some insight there?

     

    Larry

    Tuesday, June 5, 2007 4:53 PM
  • I'm pretty much in the same boat and one of the issues that I’m currently running into is how to get the agent to apply changes to rows that have been updated on the server.  I create a new SyncContext object, create a new dataset, create a new SyncTableProgress object that hosts its own SyncTable.  To the dataset, I add all of the modified and inserted rows and update the SyncTable object to reflect those changes. 

     

    However (as expected) the Client Agent is having trouble Sync'ing the modified rows because it seeing them as new rows with duplicate keys.  So my question is... how do you relay information about changed rows and deleted rows within the dataset.  Right now, the SyncServerProvider is running on the client so I could get the local data and do a merge prior to returning the dataset.  But that doesn't solve the question of how to pull this off once the SyncServerProvider is moved off into a service and all I’ll have a is a proxy.

     

    I'm prototyping what will end up being a Java based web service on the back end that I'll need to sync up with.  I'm currently just trying to get the GetChanges() method to work.

     

    TIA -

     

    Tuesday, March 11, 2008 7:35 AM