none
Syncing a particular scope fails RRS feed

  • Question

  • I have about 10 scopes I am syncing.  Most of them happen quickly.  Here is the log on info mode for a brand new client CE db...

    INFO   , w3wp, 24, 08/20/2012 16:46:30:656, ----- Enumerating Changes for Scope "Contract" -----
    INFO   , w3wp, 24, 08/20/2012 16:46:30:656,          Source Scope Id: 4a19a31220c74517a511cd3513edc1ce
    INFO   , w3wp, 24, 08/20/2012 16:46:30:656,     Destination Scope Id: d4c17a9dae3d4c748641c330374b8bb7
    INFO   , w3wp, 24, 08/20/2012 16:46:30:656,    Change Tracking Model: Decoupled
    INFO   , w3wp, 24, 08/20/2012 16:46:30:656,    ----- Table "ContractHeader" -----
    INFO   , w3wp, 24, 08/20/2012 16:46:30:787,       Inserts: 3718
    INFO   , w3wp, 24, 08/20/2012 16:46:30:787,       Deletes: 0
    INFO   , w3wp, 24, 08/20/2012 16:46:30:787,       Updates: 0
    INFO   , w3wp, 24, 08/20/2012 16:46:30:787,       Changes Enumerated: 3718
    INFO   , w3wp, 24, 08/20/2012 16:46:30:787,    --- End Table "ContractHeader" ---
    INFO   , w3wp, 24, 08/20/2012 16:46:30:787, 
    INFO   , w3wp, 24, 08/20/2012 16:46:30:787,    ----- Table "ContractLineItem" -----
    INFO   , w3wp, 24, 08/20/2012 16:46:32:180,       Inserts: 45441
    INFO   , w3wp, 24, 08/20/2012 16:46:32:180,       Deletes: 0
    INFO   , w3wp, 24, 08/20/2012 16:46:32:180,       Updates: 0
    INFO   , w3wp, 24, 08/20/2012 16:46:32:180,       Changes Enumerated: 45441
    INFO   , w3wp, 24, 08/20/2012 16:46:32:180,    --- End Table "ContractLineItem" ---
    INFO   , w3wp, 24, 08/20/2012 16:46:32:180, 
    INFO   , w3wp, 24, 08/20/2012 16:46:32:180, --- End Enumerating Changes for Scope "Contract" ---


    All is well there.  I get to one particular scope and I get this...

    INFO   , w3wp, 31, 08/20/2012 16:47:59:569,    ----- Table "InspectionComponentDetail" -----
    INFO   , w3wp, 31, 08/20/2012 16:48:02:176,       Inserts: 38772
    INFO   , w3wp, 31, 08/20/2012 16:48:02:176,       Deletes: 14343
    INFO   , w3wp, 31, 08/20/2012 16:48:02:176,       Updates: 0
    INFO   , w3wp, 31, 08/20/2012 16:48:02:176,       Changes Enumerated: 53115
    INFO   , w3wp, 31, 08/20/2012 16:48:02:176,    --- End Table "InspectionComponentDetail" ---

    The sync call will typically timeout, but recently I have been getting this message...

    Exception of type 'System.OutOfMemoryException' was thrown.

    Are the stats shown for InspectionComponentDetail out of whack?  What can I do to fix this?

    Any help would be greatly appreciated.



    Monday, August 20, 2012 5:13 PM

All replies

  • SqlSyncStoreMetadataCleanup?
    Monday, August 20, 2012 8:29 PM
  • Tuesday, August 21, 2012 5:42 AM
    Moderator
  • Thanks for your help JuneT.  I have set MemoryDataCacheSize to 3000 on both the server and client.  Way bigger than any of the rows in my database.  I am not getting the OutOfMemory exception any longer.  

    I now get the following error...

    The message could not be processed. This is most likely because the action 'http://tempuri.org/IRelationalSyncContract/GetChanges' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding.

    I have my sendTimeout and receiveTimeout set to 5 minutes in software and in the web.config.

    Any help would be appreciated.

    Tuesday, August 21, 2012 3:07 PM
  • Just a little more info...

    All my other scopes sync in a few seconds, just when I get to the last 4 table scope, it takes forever and I finally get the error message above.

    Tuesday, August 21, 2012 3:18 PM
  • I seem to have fixed the timeout problem by setting MemoryDataCacheSize to 2000.

    Looking at the sync trace, the server is chunking this particular sync into 11 2MB chunks.  

    Watching Fiddler on the client, my program is alternating calls between GetChanges and DownloadBatchFile.

    According to Fiddler, the DownloadBatchFile call is about 3.9 MB.  Seems reasonable with the 2 MB chunk.

    The GetChanges call is downloading 33 MB each time.  Why is that so large?  Do I need to call that 11 times in this scenario?

    Tuesday, August 21, 2012 4:37 PM
  • did you write your own WCF implementation or copied it based on the samples.

    so GetChanges actually grabs 33MB from your server and downloads it separately from the DownloadBatchFile?

    Wednesday, August 22, 2012 1:25 AM
    Moderator
  • Copied almost verbatim from the WebSharingAppDemo.  

    If you look at the RelationalProviderProxy.GetChangeBatch method, it makes a call to proxy.GetChanges and later it calls proxy.DownloadBatchFile.  There isn't a for loop or anything in there.  

    And to top it off, the four tables in this scope have a max of 44K records in them.  

    Wondering what I am doing wrong.

    Wednesday, August 22, 2012 3:04 AM