DbSyncProvider Class
Encapsulates a peer synchronization provider that communicates with a peer database and shields the synchronization agent from the specific implementation of the database.
This API is not CLS-compliant.
Inheritance Hierarchy
System.Object
Microsoft.Synchronization.SyncProvider
Microsoft.Synchronization.KnowledgeSyncProvider
Microsoft.Synchronization.Data.RelationalSyncProvider
Microsoft.Synchronization.Data.DbSyncProvider
Namespace: Microsoft.Synchronization.Data
Assembly: Microsoft.Synchronization.Data (in Microsoft.Synchronization.Data.dll)
Syntax
'Declaration
<CLSCompliantAttribute(False)> _
Public Class DbSyncProvider _
Inherits RelationalSyncProvider
'Usage
Dim instance As DbSyncProvider
[CLSCompliantAttribute(false)]
public class DbSyncProvider : RelationalSyncProvider
[CLSCompliantAttribute(false)]
public ref class DbSyncProvider : public RelationalSyncProvider
[<CLSCompliantAttribute(false)>]
type DbSyncProvider =
class
inherit RelationalSyncProvider
end
public class DbSyncProvider extends RelationalSyncProvider
The DbSyncProvider type exposes the following members.
Constructors
Name | Description | |
---|---|---|
![]() |
DbSyncProvider | Initializes a new instance of the DbSyncProvider class. |
Top
Properties
Name | Description | |
---|---|---|
![]() |
ApplicationTransactionSize | Gets or sets the maximum transaction size used during change application, in kilobytes. |
![]() |
BatchingDirectory | Gets or sets the directory in which batch files are spooled to disk. (Inherited from RelationalSyncProvider.) |
![]() |
ChangeTracking | Obsolete. Gets or sets a ChangeTrackingModel enumeration value that specifies the type of change tracking that is used in all peer databases. |
![]() |
CleanupBatchingDirectory | Gets or sets whether to clean up batching files after the changes in the files have been applied to the destination. (Inherited from RelationalSyncProvider.) |
![]() |
Configuration | Not implemented by RelationalSyncProvider. An exception of type NotSupportedException is thrown if you attempt to access this property. (Inherited from RelationalSyncProvider.) |
![]() |
Connection | Gets or sets an IDbConnection object that is used to connect to the database. (Inherited from RelationalSyncProvider.) |
![]() |
DestinationCallbacks | Gets an object that a synchronization application can use to register to receive notification of events that occur during synchronization. (Inherited from KnowledgeSyncProvider.) |
![]() |
IdFormats | Gets a SyncIdFormatGroup object that is used to identify entities in a synchronization session. (Inherited from RelationalSyncProvider.) |
![]() |
MemoryDataCacheSize | Gets or sets the maximum amount of memory (in KB) that Sync Framework uses to cache changes before spooling those changes to disk. (Inherited from RelationalSyncProvider.) |
![]() |
ScopeCleanupTimestampColName | Gets or sets the name the column in the scope information table that contains the timestamp value when the most recent tombstone cleanup was performed for this scope. |
![]() |
ScopeForgottenKnowledgeColName | Gets or sets the name the column in the scope information table that contains a binary representation of the forgotten knowledge for each scope. |
![]() |
ScopeIdColName | Gets or sets the name the column in the scope information table that contains an identifier for the scope, typically a GUID. |
![]() |
ScopeKnowledgeColName | Gets or sets the name the column in the scope information table that contains a binary representation of the synchronization knowledge for each scope. |
![]() |
ScopeLocalIdColName | Gets or sets the name the column in the scope information table that contains an integer identifier for the scope. |
![]() |
ScopeName | Gets or sets the name of the scope to synchronize. (Inherited from RelationalSyncProvider.) |
![]() |
ScopeNameColName | Gets or sets the name the column in the scope information table that contains the name of the scope. |
![]() |
ScopeTimestampColName | Gets or sets the name the column in the scope information table that contains the timestamp value when the metadata row was last updated. |
![]() |
SelectNewTimestampCommand | Gets or sets an IDbCommand object that contains the query or stored procedure that returns a new timestamp value from the peer database. The timestamp defines the upper bound for the set of changes to be synchronized during the current session. |
![]() |
SelectOverlappingScopesCommand | Gets or sets an IDbCommand object that contains the query or stored procedure that returns the scope name and table name for all tables in the specified scope that are also included in other scopes. |
![]() |
SelectScopeInfoCommand | Gets or sets an IDbCommand object that contains the query or stored procedure that returns scope metadata from the peer database. |
![]() |
SelectTableMaxTimestampsCommand | Gets or sets an IDbCommand object that contains the query or stored procedure that selects the maximum timestamp from each base table or tracking table, to determine whether for each table the destination already has all of the changes from the source. |
![]() |
SyncAdapters | Gets the DbSyncAdapterCollection that is associated with the DbSyncProvider object. |
![]() |
SyncProviderPosition | Gets or sets a SyncProviderPosition enumeration value that represents whether a provider is associated with the local or remote database. (Inherited from RelationalSyncProvider.) |
![]() |
UpdateScopeCleanupTimestampCommand | Gets or sets an IDbCommand object that contains the query or stored procedure that updates the scope_cleanup_timestamp column for a particular scope in the scope_info table, to mark the point up to which cleanup has been performed for the scope. |
![]() |
UpdateScopeInfoCommand | Gets or sets an IDbCommand object that contains the query or stored procedure that updates scope metadata in the peer database. |
Top
Methods
Name | Description | |
---|---|---|
![]() |
BeginSession | Called by the SyncOrchestrator to indicate that a synchronization session has started. (Inherited from RelationalSyncProvider.) |
![]() |
CleanupMetadata | Removes change tracking metadata from the database and updates the cleanup knowledge to reflect the point where the cleanup process stopped. This enables outdated nodes to be identified. |
![]() |
CreateApplicationTransaction | Creates a read-committed transaction over which to apply changes to the database. (Inherited from RelationalSyncProvider.) |
![]() |
CreateEnumerationTransaction | Creates a read-committed transaction over which to enumerate changes from the database. (Inherited from RelationalSyncProvider.) |
![]() |
Dispose() | Releases all resources that are used by the RelationalSyncProvider. (Inherited from RelationalSyncProvider.) |
![]() |
Dispose(Boolean) | Releases the unmanaged resources used by the RelationalSyncProvider and optionally releases the managed resources. (Inherited from RelationalSyncProvider.) |
![]() |
EndSession | Called by the SyncOrchestrator object to indicate that a synchronization session has ended. (Overrides RelationalSyncProvider.EndSession(SyncSessionContext).) |
![]() |
Equals | (Inherited from Object.) |
![]() |
Finalize | (Inherited from Object.) |
![]() |
GetChangeBatch | Gets a batch of changes to synchronize when given batch size, destination knowledge, and change data retriever parameters. (Inherited from RelationalSyncProvider.) |
![]() |
GetFullEnumerationChangeBatch | Gets a batch of changes to synchronize when given batch size, lower bound, knowledge, and change data retriever parameters. (Inherited from RelationalSyncProvider.) |
![]() |
GetHashCode | (Inherited from Object.) |
![]() |
GetScopeDescription | Returns a DbSyncScopeDescription object that contains the schema for the tables that are in the SyncAdapters collection. |
![]() |
GetSyncBatchParameters | Gets the number of kilobytes of data that will be included in change batches, and the current knowledge for the synchronization scope. (Inherited from RelationalSyncProvider.) |
![]() |
GetType | (Inherited from Object.) |
![]() |
MemberwiseClone | (Inherited from Object.) |
![]() |
OnApplyChangeFailed | Raises the ApplyMetadataFailed event. (Inherited from RelationalSyncProvider.) |
![]() |
OnApplyingChanges | Raises the ApplyingChanges event. (Inherited from RelationalSyncProvider.) |
![]() |
OnApplyMetadataFailed | Raises the ApplyMetadataFailed event. (Inherited from RelationalSyncProvider.) |
![]() |
OnChangesApplied | Raises the ChangesApplied event. (Inherited from RelationalSyncProvider.) |
![]() |
OnChangesSelected | Raises the ChangesSelected event. (Inherited from RelationalSyncProvider.) |
![]() |
OnDbConnectionFailure | Raises the DbConnectionFailure event. (Inherited from RelationalSyncProvider.) |
![]() |
OnPeerOutdated | Raises the SyncPeerOutdated event. (Inherited from RelationalSyncProvider.) |
![]() |
OnSelectingChanges | Raises the SelectingChanges event. (Inherited from RelationalSyncProvider.) |
![]() |
OnSyncProgress | Raises the SyncProgress event. (Inherited from RelationalSyncProvider.) |
![]() |
ProcessChangeBatch | Processes a batch of changes when given resolution policy, source changes, change data retriever, callback, and statistics parameters. (Inherited from RelationalSyncProvider.) |
![]() |
ProcessFullEnumerationChangeBatch | Processes a batch of changes when given resolution policy, source changes, change data retriever, callback, and statistics parameters. (Inherited from RelationalSyncProvider.) |
![]() |
ToString | (Inherited from Object.) |
Top
Events
Name | Description | |
---|---|---|
![]() |
ApplyChangeFailed | Occurs during uploading, after failing to apply a row at a node. (Inherited from RelationalSyncProvider.) |
![]() |
ApplyingChanges | Occurs during uploading, after connecting to the database but before applying changes. (Inherited from RelationalSyncProvider.) |
![]() |
ApplyMetadataFailed | Occurs during uploading, after failing to apply metadata for a row. (Inherited from RelationalSyncProvider.) |
![]() |
BatchApplied | Occurs after each batch of changes has been applied to the destination. (Inherited from RelationalSyncProvider.) |
![]() |
BatchSpooled | Occurs after each batch of changes has been written to disk. (Inherited from RelationalSyncProvider.) |
![]() |
ChangesApplied | Occurs during uploading, after applying changes but before disconnecting from the database. (Inherited from RelationalSyncProvider.) |
![]() |
ChangesSelected | Occurs during downloading, after enumerating changes but before disconnecting from the database. (Inherited from RelationalSyncProvider.) |
![]() |
DbConnectionFailure | Occurs when the database connection fails during change application. (Inherited from RelationalSyncProvider.) |
![]() |
SelectingChanges | Occurs during downloading, after connecting to the database but before selecting changes. (Inherited from RelationalSyncProvider.) |
![]() |
SyncPeerOutdated | Occurs before enumeration of changes if the destination node is outdated. (Inherited from RelationalSyncProvider.) |
![]() |
SyncProgress | Occurs during the selection of changes (per table) and the application of changes (per row). (Inherited from RelationalSyncProvider.) |
Top
Remarks
The principal activities of the peer synchronization provider are as follows:
Stores information about tables on the peer that are enabled for synchronization.
Enables applications to retrieve changes that occurred in the peer database since the last synchronization.
Applies incremental changes to the peer database.
Detects conflicting changes.
Examples
The following code example instantiates local and remote providers and calls the SetupSyncProvider method in a sample class that was created for this documentation. This method is used so that providers can be configured easily for multiple peers. Several provider commands are specified within this method. For more information about these commands and to view this code in the context of a complete example, see How to: Provision a Server Database for Collaborative Synchronization (Non-SQL Server).
DbSyncProvider localProvider = new DbSyncProvider();
DbSyncProvider remoteProvider = new DbSyncProvider();
//Create a provider by using the SetupSyncProvider on the sample class.
sampleSyncProvider.SetupSyncProvider(localProviderConnString, localProvider);
localProvider.SyncProviderPosition = SyncProviderPosition.Local;
sampleSyncProvider.SetupSyncProvider(remoteProviderConnString, remoteProvider);
remoteProvider.SyncProviderPosition = SyncProviderPosition.Remote;
Dim localProvider As New DbSyncProvider()
Dim remoteProvider As New DbSyncProvider()
'Create a provider by using the SetupSyncProvider on the sample class.
sampleSyncProvider.SetupSyncProvider(localProviderConnString, localProvider)
localProvider.SyncProviderPosition = SyncProviderPosition.Local
sampleSyncProvider.SetupSyncProvider(remoteProviderConnString, remoteProvider)
remoteProvider.SyncProviderPosition = SyncProviderPosition.Remote
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.