[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Sync Framework Progress

Posted on 2010-09-19
3
Medium Priority
?
2,827 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

656 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