Solved

Sync Framework Progress

Posted on 2010-09-19
3
2,641 Views
Last Modified: 2012-05-10
How do you track progress in MS Sync Framework 2.1?  I need to be able to monitor sync progress in bytes, as in the total number of bytes to download vs. how many have been downloaded so far.  The databases I'm syncing are hundreds of megabytes large and the clients have very slow connections, sometimes dial-up speed or even less.

SqlSyncProvider.MemoryDataCacheSize allows me to batch the downloads, which is nice for slow connections, but when synchronization is in progress I have no idea what's going on.

SqlSyncProvider.BatchSpooled will tell me when a batch has been downloaded, but only AFTER it has been download.  I need progress updates before and during streaming.  I also need to know the total number of batches and the sizes for each beforehand.

SyncOrchestrator.SessionProgress gives me some progress notifications, but not enough.  It gives me one notice at 50% of a scope and one at 100%.  It can take 20+ minutes before I even get to the 50% marker, so this is worthless.

Solutions please?
0
Comment
Question by:aj2010
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 51

Expert Comment

by:Mark Wills
ID: 33714726
Well, interesting problem....

From : http://msdn.microsoft.com/en-us/magazine/dd569762.aspx

We are told : "You can configure the provider to report the progress of the synchronization instead of using the default configuration. By default, the provider will report progress by calling the ProgressChanged event of the associated SyncCallback objects. You can change this behavior by implementing your own progress reporting. To do this, you need to implement events at the item level using the WorkEstimate event of the ItemChange class, or at the Batch level using the BatchWorkEstimate event of the ChangeBatch class. Then within your provider code, you can call the OnProgressChanged method of the provider to report the change whenever you think that is appropriate."

So, searching for examples, came across : http://msdn.microsoft.com/en-us/library/cc807387(SQL.110).aspx

Which leads into : http://msdn.microsoft.com/en-us/library/microsoft.synchronization.syncsessioncontext.onprogresschanged(v=SQL.110).aspx

Sorry about all the links, but it really wasnt until I saw your question that I even considered a custom progress bar (only use Sync Framework with really small data).

Anyway, hope it steers you toward a solution, and will be interested to see what other experts can post.
0
 

Author Comment

by:aj2010
ID: 33716119
The ProgressChanged event has basically the same problem as other events I previously mentioned, namely providing too little data.  WorkEstimate and BatchWorkEstimate provide more info, but still not at the level I require.  They just give me details about a specific batch, how big it is, the location of the batch file, and details about the batch itself, the scope, included tables, # records, etc.  The big problem is they only report info on batches AFTER they have been downloaded.  So it could take minutes or hours for a batch to transmit and during that time there are no events fired... so that makes it somewhat useless for what I'm trying to do.

At this point I think the only way to solve this problem is to move away from a 2-Tier implementation towards an N-Tier.  Then I would have a proxy between the sync providers.  I then use the sync providers to generate the batch files and use the proxy to manage transmission myself... which should put me in a position to monitor the status of the transmission.

I've been doing nothing but trying to figure out N-Tier since my last post to see if this will work.  There are not really any good examples of N-Tier, so I'm beating my head right now.  Help anyone?
0
 

Accepted Solution

by:
aj2010 earned 0 total points
ID: 33759517
My previous comment was indeed the answer.  By using an N-Tier implementation I was able to step in between the sync framework client- and server-side and control the data transmission.  I used a WCF service on the server and an interface proxy on the client-side.  Any communication vehicle could be used though.  
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question