Solved

Sync Framework Progress

Posted on 2010-09-19
3
2,587 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
  • 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

920 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now