How the Synchronization Functionality Works with the Remoting Provider

Important

This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Applications should instead use WCF Data Service.

The two distinct components involved in buffered updating are the cursor component and the synchronization component. The cursor component is responsible for buffering the data and exposing the data as an OLE DB rowset. The synchronization functionality works within the Cursor Service component by synchronizing changes made through the rowset with the data store and by updating the rowset with values changed in the data store outside the rowset.

The goal of synchronization is to reflect changes to the original data store in the client cursor. To do this when the Remoting Provider is used, the provider returns a Cursor Service component rowset object when the consumer requests a new rowset. If changes are made to this rowset and the consumer calls IRowsetUpdate::Update, IRowsetResynch::ResynchRows, or IRowsetRefresh::RefreshVisibleData on a rowset, the Cursor Service component synchronizes the rowset with the one exposed by the Remoting Provider.

The provider then creates a wrapper rowset object, which adds calls to GetNextRows and GetPendingRows to the same Cursor Service component method calls. These two methods keep track of the order in which they return rows. The rows with pending changes are returned by GetPendingRows, whereas the rows without pending changes are returned by GetNextRows. Returning DBPENDINGSTATUS_NOCHANGE and then calling GetOriginalData for GetData hides the pending changes on these rows.

The Persistence Provider is used to pass the updated rows to the DataFactory on the server. Once the changed rows are on the server, the synchronization component creates another Cursor Service component on the server and loads it with all the rows. GetPendingRows and GetNextRows are used to fetch the rows from the Cursor Service component. Synchronization is performed when the component calls IRowsetUpdate::Update or IRowsetRefresh::RefreshVisibleData.

The RowStatus array is returned by the Update or RefreshVisibleData method. The rowset that the Remoting Provider receives will be missing successfully deleted rows but will be in the same order as the rows sent.

Using the RowStatus array, the Remoting Provider will finally make the necessary changes to the client Cursor Service rowset.

See Also

Reference

IRowsetRefresh

IRowsetResynch

IRowsetUpdate::Update

Concepts

The Cursor Service for OLE DB