none
Windows Mobile slow sync RRS feed

  • Question

  • Hi All,

    I've finally (after 3 days) gotten my Windows Mobile 6.0 Pro app to have built in syncing.  This is back to a SQL 2008 server via a WCF web service.  Sync Services and WCF were both new to me so it's been a long few days.

    When it finally started working (BTW anyone using CFClientBase needs to remember that your root namespace can really screw this one up!) I found it to be very slow.  Initial sync I thought.  On subsequent syncs it seems just as slow (even with 0 downloads and 0 updates).

    I hooked into the SyncProgress event for the SqlCeClientSyncProvider and experience some really odd stuff.  Essentially it seems that the same amount of data is coming down to the client from the server on secondary updates as per the initial sync. 

    Once the sync has finished the first time 6900ish downloads were reported by way of TotalChangesDownloaded.  On secondary sync this and the TotalChangesUploaded both report 0.  It seems really weird to me and after battling for so long with this and now having it working only to be so slow I need a second opinion.

    Is Sync Services really meant to be this slow or have I done something stupid.  BTW, when running from a desktop app the download goes really fast.

    Last Q, I don't want to have to use Merge Replication and want to replace that on another of my apps.  Is Sync Services (when it's working properly) faster than merge replication?

    Thanks in advance for any help,

    Jon

    Friday, August 20, 2010 2:55 PM

All replies

  • have you tried applying this fix? http://support.microsoft.com/kb/973058
    Friday, August 20, 2010 3:25 PM
    Moderator
  • Hi,

    Thanks for that.  I've installed it (removing the old one from the emulator first) but it doesn't seem to be any faster.  Do I have to change the app at all to use the SQLCEResultSet or is that an internal thing?

    Edit: Actually the resync does seem to be faster now although it takes quite a while even with no changes.  Should it be near instant if there are no changes?

    Regards,

    Jon

    Saturday, August 21, 2010 8:40 AM
  • i guess it depends on the number of tables and sync direction.

    for each table you're synchronizing, Sync Fx has to fire a query each for Inserts, Updates and Deletes. If it's BiDirectional, the same happens on both sides(client and server), add to this the queries to retrieve the current anchor values, retrieve a new anchor value and set the new anchor values.

    Monday, August 23, 2010 8:09 AM
    Moderator
  • Hi,

    I agree that it should take a while but for the number of tables that I'm using (15 down only and 2 up only) I'm finding that a secondary sync takes on average 1 minute 40 seconds  (sometimes 1 min 20 seconds).  A first sync takes 3 minutes 15 seconds with 6660 inserts. 

    I'm now having a play with the SyncTracer to see if anything weird is going on -- I'm sure that something odd must be happening.  That would be great if I could just get the logfile to output but using the trace.config.text file just doesn't seem to work.   Oh well, another few days of hair pulling!

    Regards,

    Jon

    Monday, August 23, 2010 9:57 AM
  • I'm having problems getting the SyncTracer to work - I've added in the config file for it set it up - even saving as UTF8 to ensure that it's correct but not output.  I have noticed one thing, in the output window it seems that there is an exception raised just after a pause.  I'm wondering if that is what is slowing the sync down.  From some other posts I've seen that the SLQCE queries take a matter of 1-2 seconds max and as such I think that there is something else going on. Below is a copy of some of the Output

    The thread 0xd68dad12 has exited with code 0 (0x0).
    A first chance exception of type 'System.UriFormatException' occurred in System.dll
    The thread 0xd68dad12 has exited with code 0 (0x0).
    The thread 0xd68dad12 has exited with code 0 (0x0).
    The thread 0x96ce730e has exited with code 0 (0x0).
    The thread 0x3366dfe has exited with code 0 (0x0).
    A first chance exception of type 'System.UriFormatException' occurred in System.dll
    The thread 0x96ce730e has exited with code 0 (0x0).
    The thread 0x2272d31a has exited with code 0 (0x0).

    I've seen that the exception is caused by something to do with the proxy and am trying to track it down - if anyone has any pointers I'd be very grateful!

    Regards,

    Jon

    Monday, August 23, 2010 12:15 PM
  • try enabling WCF Tracing or modify your service configuration to include exception details.

    Monday, August 23, 2010 4:15 PM
    Moderator
  • The exception occurs when starting a sync and the reason for the large number of them was that I had a lot of sync groups enabled.  I've combined all into one sync group and the sync still takes forever but I get less of the errors and they do seem to be unrelated to the speed issue.

    I'm back onto trying to get the sync trace working. I have the following in a file called trace.config.txt

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <traceSettings>
            <add key="FileLocation" value="\My Documents\WorkWillYou.txt" />
            <add key="LogLevel" value="4" />
        </traceSettings>
    </configuration>

    I get nothing back and when looking at the SyncTracer.IsVerboseEnabled() status in the application it and all the others show as false.  The only thing that I can come up with is that either the file isn't being read properly OR that the functionality to load the file isn't enables in the version that I'm using.

    I've been refering to this thread http://social.microsoft.com/forums/en-us/uklaunch2007ado.net/thread/D27670DC-74D2-4E0C-BDD1-315A5E7A75AF and that tells me that I'm doing the right stuff but to no avail.

    Any ideas?

    Regards,

    Jon

    Tuesday, August 24, 2010 9:37 AM