Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

DbOutdatedSyncException Class

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

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)

[SerializableAttribute]
public class DbOutdatedSyncException : DbSyncException

The DbOutdatedSyncException type exposes the following members.

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

  NameDescription
Public propertyData (Inherited from Exception.)
Public propertyDbSyncStageGets or sets a DbSyncStage enumeration value that represents the stage of synchronization during which the error occurred. (Inherited from DbSyncException.)
Public propertyErrorNumber Obsolete. Gets or sets an error number for the exception. (Inherited from SyncException.)
Public propertyHelpLinkGets or sets the URL of a help page with information about the exception. (Inherited from DbSyncException.)
Protected propertyHResult (Inherited from Exception.)
Public propertyInnerException (Inherited from Exception.)
Public propertyMessage (Inherited from Exception.)
Public propertyMissingCleanupKnowledgeGets or sets a ForgottenKnowledge object that contains metadata about cleanup knowledge that the peer is missing.
Public propertyOutdatedPeerSyncKnowledgeGets or sets a SyncKnowledge object that contains metadata about knowledge the peer has that is outdated.
Public propertySource (Inherited from Exception.)
Public propertyStackTrace (Inherited from Exception.)
Public propertySyncProviderPositionGets or sets the SyncProviderPosition enumeration value that represents whether a provider is associated with the local or remote database.
Public propertySyncSourceGets or sets the name of the component that threw the exception. (Inherited from DbSyncException.)
Public propertySyncStage Obsolete. Gets or sets a SyncStage enumeration value that represents the stage of synchronization during which the error occurred. (Inherited from SyncException.)
Public propertyTargetSite (Inherited from Exception.)
Top

  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetBaseException (Inherited from Exception.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetObjectDataPopulates a SerializationInfo object with information about the exception. (Overrides DbSyncException.GetObjectData(SerializationInfo, StreamingContext).)
Public methodGetType (Inherited from Exception.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Exception.)
Top

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


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2015 Microsoft