Sync over WCF - Connection lost during sync, what to do? RRS feed

  • Question

  • Hello,

    We have a wcf hosted sync service running to synchronize devices (sql compact) with our sql database.

    We basically followed the WCF sample at with a RelationalProviderProxy class


    Currently we are facing problems when the connection during sync is lost in an UploadOnly scenario

    The problem is: Sometimes when the connection is gone the sync "thinks" that all rows were all processed - but that's not true. They changes were not successfully processed at the server.

    Somehow the "client" thinks that the rows were processed correctly and thats why the client is not sending the rows again with the next sync. It looks like that the service dies somehow or get a timeout - but how can it happen that the client thinks that everything was processed?

    Any ideas?


    System.ServiceModel.CommunicationException: The underlying connection was closed: The connection was closed unexpectedly. ---> System.Net.WebException: The underlying connection was closed: The connection was closed unexpectedly.
       at System.Net.HttpWebRequest.GetResponse()
       at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
       --- End of inner exception stack trace ---

    • Edited by tom54321 Wednesday, July 16, 2014 1:44 PM
    Tuesday, July 15, 2014 2:11 PM

All replies

  • run a WCF trace or Sync Fx trace to get more details on your error.

    if you're subsequent sync after the error thinks the previous upload has succeeded, then it has succeeded.

    before it does an upload, it asks the destination what it knows about the source. if the destination says it has received the previous one then it has succeeded.

    check that you're running into conflicts or errors during sync.

    Tuesday, July 22, 2014 2:08 AM