none
How can I show more informative Statistics to the end user RRS feed

  • Question

  • Currently the only information that I can show the user regarding the Sync is Uploads Attempted, Uploads Failed, Downloads Attempted, Downloads failed. I would like to provide more detailed information such as [TableName] Uploads attempted, [TableName] Uploads Failed etc. I would also like to provide more detailed information on the Conflicts that caused the Uploads/Downloads to fail.

    I know that there is the ApplyChangesFailed event, but because I am using WCF I think this only gives me information for the client.

    Any ideas?

    Wednesday, May 19, 2010 3:16 PM

Answers

  • 1. Am referring to the ApplyChanges on the WCF proxy on the client side and not the ApplyChanges event of the client or local provider. The SyncContext in the WCF proxy ApplyChanges would contain the stats for what was uploaded. The ApplyChanges on the local provider is for what was downloaded.

    2. You're right, you dont get to check which changes was applied. But rather than checking which was applied (which i would assume will be more than what failed), I suggest you just check which one failed and assume everything else as applied. On the SyncContext->SyncGroupProgress->SyncTableProgress above or on inside the WCF service ApplyChanges on the server side, you can check the contents of the conflicts collection  and query the database to reconfirm if the conflicts has been resolved. If they've been resolved (changes was confirmed to have been applied), then just remove them from the conflicts collection. On the client side, mark all records within the change dataset (SyncContext.DataSet) as applied except for those rows in the SyncContext->SyncGroupProgress->SyncTableProgress->Conflicts.

     

    hth

    • Marked as answer by gs_ham Wednesday, December 8, 2010 7:55 PM
    Tuesday, June 15, 2010 3:37 PM
    Moderator

All replies

  • Hi,

    With n-tier WCF deployment, you can register callbacks to server events on the WCF service side. To return interesting informatio related to these service events, you can either let client to periodically pull information from service with an new WCF contract API, or implement a WCF callback.

    Thanks,

    Dong


    This posting is provided AS IS with no warranties, and confers no rights.
    Wednesday, May 19, 2010 5:10 PM
    Moderator
  • Are WCF Callbacks supported on Compact Framework? I thought I read that they are not supported.
    Wednesday, June 9, 2010 3:16 PM
  • You could try the other way to use a different operation contract to get the service side information.
    Thursday, June 10, 2010 7:49 PM
    Answerer
  • if you are using WCF, locate the ApplyChanges call on the service proxy which returns a SyncContext. You can get statistics from the SyncGroupProgress of the SyncContext and inside the SyncGroupProgress, you'll also find the SyncTableProgress for the individual tables statistics.
    Sunday, June 13, 2010 5:39 AM
    Moderator
  • Thanks JuneT, you have helped me a few times with Sync. Yes I am using WCF and this is running on CompactFramework.

    So can you clear up a few things for me?

    1. If I use the SyncContext/SyncGroupProgress from the ApplyChanges event on the client, will that give me upload info as well?

    2. This relates somewhat to another post I have about being able to tell which records actually synced or failed from the WCF service. It appears that there is not a good way to do this within the Sync framework. Essentially I need to mark records as being synced so that they can periodically be deleted from the client DB.

     

    Monday, June 14, 2010 1:02 PM
  • 1. Am referring to the ApplyChanges on the WCF proxy on the client side and not the ApplyChanges event of the client or local provider. The SyncContext in the WCF proxy ApplyChanges would contain the stats for what was uploaded. The ApplyChanges on the local provider is for what was downloaded.

    2. You're right, you dont get to check which changes was applied. But rather than checking which was applied (which i would assume will be more than what failed), I suggest you just check which one failed and assume everything else as applied. On the SyncContext->SyncGroupProgress->SyncTableProgress above or on inside the WCF service ApplyChanges on the server side, you can check the contents of the conflicts collection  and query the database to reconfirm if the conflicts has been resolved. If they've been resolved (changes was confirmed to have been applied), then just remove them from the conflicts collection. On the client side, mark all records within the change dataset (SyncContext.DataSet) as applied except for those rows in the SyncContext->SyncGroupProgress->SyncTableProgress->Conflicts.

     

    hth

    • Marked as answer by gs_ham Wednesday, December 8, 2010 7:55 PM
    Tuesday, June 15, 2010 3:37 PM
    Moderator
  • Thanks JuneT, this sounds like exactly what I need.

    Wednesday, June 23, 2010 5:53 PM