SqlMetadataStore Class
Represents a metadata store that is implemented by using a lightweight database to store the metadata.
Inheritance Hierarchy
System.Object
Microsoft.Synchronization.MetadataStorage.MetadataStore
Microsoft.Synchronization.MetadataStorage.SqlMetadataStore
Namespace: Microsoft.Synchronization.MetadataStorage
Assembly: Microsoft.Synchronization.MetadataStorage (in Microsoft.Synchronization.MetadataStorage.dll)
Syntax
'Declaration
Public Class SqlMetadataStore _
Inherits MetadataStore _
Implements IDisposable
'Usage
Dim instance As SqlMetadataStore
public class SqlMetadataStore : MetadataStore,
IDisposable
public ref class SqlMetadataStore : public MetadataStore,
IDisposable
type SqlMetadataStore =
class
inherit MetadataStore
interface IDisposable
end
public class SqlMetadataStore extends MetadataStore implements IDisposable
The SqlMetadataStore type exposes the following members.
Methods
Name | Description | |
---|---|---|
BeginTransaction() | Starts an explicit transaction on the metadata store that has an isolation level of ReadCommitted. | |
BeginTransaction(IsolationLevel) | Starts an explicit transaction on the metadata store that has the specified isolation level. (Overrides MetadataStore.BeginTransaction(IsolationLevel).) | |
CommitTransaction | Commits an explicit transaction that has already started on the metadata store. (Overrides MetadataStore.CommitTransaction().) | |
CreateStore(String) | Creates a metadata store file that has the specified name and location, and returns a metadata store object that represents it. | |
CreateStore(String, CultureInfo) | Creates a metadata store file that has the specified name, location, and locale; and returns a metadata store object that represents it. | |
Dispose | Releases the resources that are used by SqlMetadataStore. | |
Equals | (Inherited from Object.) | |
Finalize | Finalizer for SqlMetadataStore. (Overrides Object.Finalize().) | |
GetHashCode | (Inherited from Object.) | |
GetMetadataStoreSerializer | Gets an object that serializes and deserializes the metadata store to and from the canonical format. | |
GetReplicaMetadata | Gets a replica metadata object that is used to access replica metadata in the metadata store. (Overrides MetadataStore.GetReplicaMetadata(SyncIdFormatGroup, SyncId).) | |
GetSingleReplicaMetadata | Gets the metadata for the single replica contained in the metadata store. (Overrides MetadataStore.GetSingleReplicaMetadata().) | |
GetType | (Inherited from Object.) | |
InitializeReplicaMetadata | Creates and initializes metadata for a replica in the metadata store, and returns a replica metadata object that is used to access the replica metadata. (Overrides MetadataStore.InitializeReplicaMetadata(SyncIdFormatGroup, SyncId, IEnumerable<FieldSchema>, IEnumerable<IndexSchema>).) | |
IsTransactionActive | Indicates whether an active transaction exists on the metadata store. (Overrides MetadataStore.IsTransactionActive(IsolationLevel%).) | |
MemberwiseClone | (Inherited from Object.) | |
OpenStore(String) | Opens an existing metadata store file that has the specified name and location, and returns a metadata store object that represents it. | |
OpenStore(String, CultureInfo) | Opens an existing metadata store file that has the specified name, location, and locale; and returns a metadata store object that represents it. | |
RemoveReplicaMetadata | Removes all metadata associated with the specified replica. (Overrides MetadataStore.RemoveReplicaMetadata(SyncIdFormatGroup, SyncId).) | |
RollbackTransaction | Cancels the current explicit transaction and rolls the metadata store back to the state it was in before the transaction was started. (Overrides MetadataStore.RollbackTransaction().) | |
ToString | (Inherited from Object.) |
Top
Events
Name | Description | |
---|---|---|
MetadataStoreUpgradeStart | Occurs when the metadata store file format is about to be upgraded. | |
MetadataStoreUpgradeStop | Occurs when the metadata store file format upgrade has finished. |
Top
Remarks
The metadata storage service offers a complete implementation of the metadata storage service API that uses a lightweight database to store all the metadata that is required for synchronization in one database file in a specified location in the file system. The entry point into this implementation is SqlMetadataStore.
To use the Sync Framework implementation of the metadata storage service API
Create a new metadata store by using CreateStore(), or open an existing metadata store by using OpenStore().
Create metadata for a specified replica by using InitializeReplicaMetadata, or open existing replica metadata by using GetReplicaMetadata. Both methods return an implementation of ReplicaMetadata that can access replica metadata that is stored in the Sync Framework metadata store.
Begin a database transaction by using BeginTransaction. This helps ensure that, for changes made to the metadata after this method is called, either all are saved to the database or none are saved.
Create new item metadata by using ReplicaMetadata.CreateItemMetadata or find metadata for individual items by using methods such as ReplicaMetadata.FindItemMetadataById. These methods return an implementation of ItemMetadata that can access item metadata that is stored in the Sync Framework metadata store.
Make changes to the item metadata and save those changes by using ReplicaMetadata.SaveItemMetadata.
Commit the changes to the metadata store by calling CommitTransaction, or discard the changes by calling RollbackTransaction.
This implementation of the API also provides a DeleteDetector object to help detect items deleted from the item store. This object is available through the ReplicaMetadata.DeleteDetector property.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Reference
Microsoft.Synchronization.MetadataStorage Namespace