DbOutdatedSyncException Class

The exception that is thrown for errors that occur when trying to synchronize a peer that has outdated metadata.

Inheritance Hierarchy

System.Object
  System.Exception
    Microsoft.Synchronization.SyncException
      Microsoft.Synchronization.Data.DbSyncException
        Microsoft.Synchronization.Data.DbOutdatedSyncException

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

Syntax

'Declaration
<SerializableAttribute> _
Public Class DbOutdatedSyncException _
    Inherits DbSyncException
'Usage
Dim instance As DbOutdatedSyncException
[SerializableAttribute]
public class DbOutdatedSyncException : DbSyncException
[SerializableAttribute]
public ref class DbOutdatedSyncException : public DbSyncException
[<SerializableAttribute>]
type DbOutdatedSyncException =  
    class
        inherit DbSyncException
    end
public class DbOutdatedSyncException extends DbSyncException

The DbOutdatedSyncException type exposes the following members.

Constructors

  Name Description
Public method DbOutdatedSyncException() Initializes a new instance of the DbOutdatedSyncException class by using default values.
Public method DbOutdatedSyncException(String) Initializes a new instance of the DbOutdatedSyncException class by using a message parameter.
Protected method DbOutdatedSyncException(SerializationInfo, StreamingContext) Initializes a new instance of the DbOutdatedSyncException class by using serialization information and streaming context parameters.
Public method DbOutdatedSyncException(String, Exception) Initializes a new instance of the DbOutdatedSyncException class by using message and inner exception parameters.

Top

Properties

  Name Description
Public property Data (Inherited from Exception.)
Public property DbSyncStage Gets or sets a DbSyncStage enumeration value that represents the stage of synchronization during which the error occurred. (Inherited from DbSyncException.)
Public property ErrorNumber Obsolete. Gets or sets an error number for the exception. (Inherited from SyncException.)
Public property HelpLink Gets or sets the URL of a help page with information about the exception. (Inherited from DbSyncException.)
Protected property HResult (Inherited from Exception.)
Public property InnerException (Inherited from Exception.)
Public property Message (Inherited from Exception.)
Public property MissingCleanupKnowledge Gets or sets a ForgottenKnowledge object that contains metadata about cleanup knowledge that the peer is missing.
Public property OutdatedPeerSyncKnowledge Gets or sets a SyncKnowledge object that contains metadata about knowledge the peer has that is outdated.
Public property Source (Inherited from Exception.)
Public property StackTrace (Inherited from Exception.)
Public property SyncProviderPosition Gets or sets the SyncProviderPosition enumeration value that represents whether a provider is associated with the local or remote database.
Public property SyncSource Gets or sets the name of the component that threw the exception. (Inherited from DbSyncException.)
Public property SyncStage Obsolete. Gets or sets a SyncStage enumeration value that represents the stage of synchronization during which the error occurred. (Inherited from SyncException.)
Public property TargetSite (Inherited from Exception.)

Top

Methods

  Name Description
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetBaseException (Inherited from Exception.)
Public method GetHashCode (Inherited from Object.)
Public method GetObjectData Populates a SerializationInfo object with information about the exception. (Overrides DbSyncException.GetObjectData(SerializationInfo, StreamingContext).)
Public method GetType (Inherited from Exception.)
Protected method MemberwiseClone (Inherited from Object.)
Public method ToString (Inherited from Exception.)

Top

Examples

The following code example synchronizes three peers and handles exceptions of type DbOutdatedSyncException.

//The SampleStats class handles information from the SyncStatistics
//object that the Synchronize method returns.
SampleStats sampleStats = new SampleStats();

try
{
    //Initial synchronization. Instantiate the SyncOrchestrator
    //and call Synchronize. Note that data is not synchronized during the
    //session between peer 1 and peer 3, because all rows have already
    //been delivered to peer 3 during its synchronization session with peer 2.
    SyncOrchestrator sampleSyncAgent;
    SyncOperationStatistics syncStatistics;

    sampleSyncAgent = new SampleSyncAgent(Utility.ConnStr_DbSync1, Utility.ConnStr_DbSync2);
    syncStatistics = sampleSyncAgent.Synchronize();
    sampleStats.DisplayStats(syncStatistics, "initial");

    sampleSyncAgent = new SampleSyncAgent(Utility.ConnStr_DbSync2, Utility.ConnStr_DbSync3);
    syncStatistics = sampleSyncAgent.Synchronize();
    sampleStats.DisplayStats(syncStatistics, "initial");

    sampleSyncAgent = new SampleSyncAgent(Utility.ConnStr_DbSync1, Utility.ConnStr_DbSync3);
    syncStatistics = sampleSyncAgent.Synchronize();
    sampleStats.DisplayStats(syncStatistics, "initial");
}


catch (DbOutdatedSyncException ex)
{
    Console.WriteLine("Outdated Knowledge: " + ex.OutdatedPeerSyncKnowledge.ToString() +
                      " Clean up knowledge: " + ex.MissingCleanupKnowledge.ToString());
}
catch (Exception ex)
{
    Console.WriteLine(ex.Message);
}
'The SampleStats class handles information from the SyncStatistics
'object that the Synchronize method returns.
Dim sampleStats As New SampleStats()

Try
    'Initial synchronization. Instantiate the SyncOrchestrator
    'and call Synchronize. Note that data is not synchronized during the
    'session between peer 1 and peer 3, because all rows have already
    'been delivered to peer 3 during its synchronization session with peer 2.              
    Dim sampleSyncAgent As SyncOrchestrator
    Dim syncStatistics As SyncOperationStatistics

    sampleSyncAgent = New SampleSyncAgent(Utility.ConnStr_DbSync1, Utility.ConnStr_DbSync2)
    syncStatistics = sampleSyncAgent.Synchronize()
    sampleStats.DisplayStats(syncStatistics, "initial")

    sampleSyncAgent = New SampleSyncAgent(Utility.ConnStr_DbSync2, Utility.ConnStr_DbSync3)
    syncStatistics = sampleSyncAgent.Synchronize()
    sampleStats.DisplayStats(syncStatistics, "initial")

    sampleSyncAgent = New SampleSyncAgent(Utility.ConnStr_DbSync1, Utility.ConnStr_DbSync3)
    syncStatistics = sampleSyncAgent.Synchronize()
    sampleStats.DisplayStats(syncStatistics, "initial")


Catch ex As DbOutdatedSyncException
    Console.WriteLine("Outdated Knowledge: " & ex.OutdatedPeerSyncKnowledge.ToString() _
                    & " Clean up knowledge: " + ex.MissingCleanupKnowledge.ToString())
Catch ex As Exception
    Console.WriteLine(ex.Message)
End Try

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.Data Namespace