IReplicaMetadata::GetChangeBatch

Gets a change batch that contains item metadata for items that are not contained in the specified knowledge from the destination provider.

Syntax

HRESULT GetChangeBatch(
  DWORD dwBatchSize,
  ISyncKnowledge *pSyncKnowledge,
ISyncChangeBatch ** ppSyncChangeBatch);

Parameters

  • dwBatchSize
    [in] The size of the batch to be created.

  • pSyncKnowledge
    [in] The knowledge from the destination provider.

  • ppSyncChangeBatch
    [out] Returns a change batch that contains item metadata for items that are not contained in the specified knowledge from the destination provider.

Return Value

  • S_OK

  • E_POINTER

  • E_INVALIDARG when dwBatchSize is 0.

Remarks

This method helps a synchronization provider implement its IKnowledgeSyncProvider::GetChangeBatch method.

Before providers call this method, they must ensure that the versions in the metadata store reflect all local changes, including deletes. This is achieved through an explicit metadata maintenance pass to enumerate items and update their metadata.

The implementation of this class that is available through ISqlSyncMetadataStore adds changes to the change batch in global ID order.

The implementation of this class that is available through ISqlSyncMetadataStore calls SetLastBatch on the returned change batch when there are no more changes to send.

Notes for Implementers

To aid a provider that uses global ID ordering and has the ability to use ranges, changes should be enumerated and added to the change batch in global ID order. The first change in the returned change batch starts a new range.

If there are no more changes to send after this batch, SetLastBatch must be called on the returned change batch, or Sync Framework will call IKnowledgeSyncProvider::GetChangeBatch again to retrieve another batch of changes.

See Also

Reference

IReplicaMetadata Interface