Bruce Ge

  Home  |   Contact  |   Syndication    |   Login
  6 Posts | 0 Stories | 11 Comments | 0 Trackbacks

News

Archives

Post Categories

for the ado database sync, the method

public virtual SyncContext ApplyChanges(SyncGroupMetadata groupMetadata, DataSet dataSet,SyncSession syncSession)

on server side is not efficient, as it receive the changed data from client side, but it again sent it back to client within the SyncContext.

In the returned SyncContext object, I found DataSet and GroupProgress.Changes is almost the same as input dataset. by verifying the code inside sync framework, I found:

internal SyncGroupMetadata ResetProivderState(SyncGroupMetadata groupMetadata, DataSet dataSet)
{
    this._rawOldAnchor = null;
    this._rawNewAnchor = null;
    this._rawMaxAnchor = null;
    this._syncContext = new SyncContext();
    this._syncContext.DataSet = dataSet;
    SyncGroupMetadata metadata = this.GenerateOrderedGroupMetadata(groupMetadata);
    this._syncContext.GroupProgress = new SyncGroupProgress(metadata, dataSet);
    return metadata;
}

so I use the code below:

SyncContext context = _serverSyncProvider.ApplyChanges(groupMetadata, dataSet, syncSession);
context.DataSet = null;
context.GroupProgress.Changes.Clear();
return context; 

to make the size smaller.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
posted on Tuesday, October 27, 2009 4:54 PM