IReplicaMetadata2::SetProviderVersion
Sets the version of the provider that operates on this metadata.
HRESULT SetProviderVersion(
ULONG ulProviderVersion);
Parameters
- ulProviderVersion
[in] The version of the provider that operates on this metadata.
Return Value
S_OK
E_OUTOFMEMORY
Remarks
The provider version is used to negotiate compatibility with other versions of a provider. Consider the following scenario:
There are three versions of a provider (v1, v2, and v3).
In v2, an incompatible change was made to the custom schema for the provider.
v2 and v3 are compatible.
A v3 provider can specify a value of v2 to SetProviderVersion. A v2 or v3 provider can then verify the provider version required to operate on the metadata by using IReplicaMetadata2::GetProviderVersion. Because this value is serialized as part of the canonical format of the metadata store, the provider version can also be verified when the metadata is deserialized, by specifying a value of v2 for the dwExpectedProviderCompatibilityVersion parameter of ISyncMetadataStoreSerializer::DeserializeReplicaMetadata. The v1 provider would expect a value of v1, and deserialization would fail by design because the metadata is incompatible with v1.
Use the lowest version possible to assure the highest level of compatibility with other versions of the same provider.