locked
My wish list for Sync Services (Devices) RTM RRS feed

  • Question

  • Hi, it's me again

    Not sure how far MS is with the RTM version of Sync Services for ADO.NET (Devices), but I thought I'd add my thoughts on how a commonly requested feature could be achieved if just two DLL files are included in the RTM release. Of course, some of this may be incorrect, so please do correct me if I'm wrong.

    The scenario is syncing two (or more) SQL Server Compact 3.5 databases in a peer to peer fashion. One of the databases would be residing on a device and another on a desktop.

    Having looked through the GBASyncServicesForDevices sample, in essence what made it work is the following:
    • Microsoft.Synchronization.Data (1.0.0.0) and Microsoft.Synchronization.Data.SqlServerCe (1.0.0.0) on the device
    • Microsoft.Synchronization.Data (1.0.0.0) and Microsoft.Synchronization.Data.Server (1.0.0.0) on the desktop (server)
    • A web service in between the two residing on the server, which is called by the device client.
    • The server had to have IIS and one of the SQL Server versions greater than SQL Server Compact.

    Moving onto Sync Framework 1.0 RTM and looking at the SharingAppDemo-DecoupledTracking sample, two new assemblies are used: Microsoft.Synchronization (1.0.0.0) and Microsoft.Synchronization.Data (2.0.0.0), which contain SyncOrchestrator, DbSyncProvider and the lot.

    So, to make peer to peer sync work on devices, we would need .NET CF versions of these two new assemblies.

    But because SQL Server Compact is to be used both on the device and desktop, there are a couple of other challenges, since SQL Server Compact does not support stored procs or output parameters. This can be overcome (I already tried this) by creating wrappers for SqlCeConnection, SqlCeCommand and SqlCeParameterCollection. In essence what I did is I added an event called CommandCompleted after an Execute* method of SqlCeCommand was called, which allowed me to populate parameters which were supposed to be output parameters with the actual values, or to execute multiple commands since stored procs are not supported.

    The beauty of DbSyncProvider, as I understand it, is that the same code can be shared across every peer node, which means that all code related to DbSyncProvider (the SqlCe* wrappers and Metadata & CRUD commands) can be shared between the device and desktop. So once the code for one node is complete you're pretty much done with database commands and DbSyncProviders.

    So armed with the following:
    • SqlCe* wrappers and DbSyncProvider code
    • Sync Framework 1.0 on the desktop
    • SQL Server Compact 3.5 on the desktop
    • SQL Server Compact 3.5 on the device
    • A web service in between
    , all that is left is the device bits of Microsoft.Synchronization (1.0.0.0) and Microsoft.Synchronization.Data (2.0.0.0) to make this work.

    Again, please correct me if any of this is wrong.
    In case I'm not wrong, is there any remote chance that the two assemblies can be compiled against the .NET Compact Framework in time for RTM?
    • Moved by Max Wang_1983 Friday, April 22, 2011 6:33 PM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Tuesday, August 12, 2008 4:23 PM

Answers

  • ivl,

     

    Thank you for your feedback!  The ability to synchronize SQL Compact in a peer to peer fashion is a common request, although I am not able to provide specifics around when this feature will be available.  Please keep an eye on our blog for more details around future CTPs. 

     

    Note that DbSyncProvider currently only supports SQL Server 2005 and 2008.  This provider cannot be used to sync SQL Compact out of the box although your ideas around extending that provider with faux stored procs is an excellent one and very similar to the approach we would take in house when we do choose to add P2P support for SQL CompactSmile.  Note that we are also thinking about device support for our next release and will post to our blog with more details as they become available.

     

     

    -Sean

     

     

    Wednesday, August 13, 2008 4:20 AM
    Moderator