Share via


IReplicaMetadata::SaveItemMetadata

Saves item metadata property changes to the metadata store.

Syntax

HRESULT SaveItemMetadata(IItemMetadata * pItemMetadata);

Parameters

  • pItemMetadata
    [in] The item metadata to save to the metadata store.

Return Value

  • S_OK

  • S_FALSE if there are no changes to save.

  • SYNC_E_METADATA_PRIMARY_KEY_CONSTRAINT when the item ID specified in pItemMetadata is not valid or a duplicate.

Remarks

This method must be called to save IItemMetadata property changes to the metadata store. If IItemMetadata properties are changed and the object is destroyed without calling this method, those changes will be lost.

We recommend that this method be called to save metadata changes after the corresponding change has been saved to the item store. This helps to ensure that the metadata is not changed if the data update fails.

The implementation of this class that is available through ISqlSyncMetadataStore performs updates within the context of a transaction that was started before this method is called.

Notes for Implementers

This method must only succeed when all the property changes were successfully committed to the metadata store. Either all property changes must be committed or none of them.

If the metadata store supports transactions, this method must apply its changes to the metadata store within the context of that transaction.

See Also

Reference

IReplicaMetadata Interface