ReplicaMetadata.SaveItemMetadata Method

When overridden in a derived class, saves item metadata property changes to the metadata store.

Namespace:  Microsoft.Synchronization.MetadataStorage
Assembly:  Microsoft.Synchronization.MetadataStorage (in Microsoft.Synchronization.MetadataStorage.dll)

Syntax

'Declaration
Public MustOverride Sub SaveItemMetadata ( _
    itemMetadata As ItemMetadata _
)
'Usage
Dim instance As ReplicaMetadata
Dim itemMetadata As ItemMetadata

instance.SaveItemMetadata(itemMetadata)
public abstract void SaveItemMetadata(
    ItemMetadata itemMetadata
)
public:
virtual void SaveItemMetadata(
    ItemMetadata^ itemMetadata
) abstract
abstract SaveItemMetadata : 
        itemMetadata:ItemMetadata -> unit 
public abstract function SaveItemMetadata(
    itemMetadata : ItemMetadata
)

Parameters

Exceptions

Exception Condition
ObjectDisposedException

The object has been disposed or was not initialized correctly.

ArgumentNullException

itemMetadata is a null reference (Nothing in Visual Basic).

KeyUniquenessException

The item is a new item and the ID already exists in the metadata store, or the ID is not valid.

Remarks

This method must be called to save ItemMetadata property changes to the metadata store. If ItemMetadata 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 SqlMetadataStore performs updates within the context of a transaction that was started before this method is called.

Notes to 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

ReplicaMetadata Class

Microsoft.Synchronization.MetadataStorage Namespace