共用方式為


DbOutdatedSyncException 類別

針對嘗試同步處理具有過期中繼資料 (Metadata) 之對等 (Peer) 時發生之錯誤擲回的例外狀況 (Exception)。

命名空間: Microsoft.Synchronization.Data
組件: Microsoft.Synchronization.Data (在 microsoft.synchronization.data.dll)

語法

'宣告
<SerializableAttribute> _
<SuppressMessageAttribute("Microsoft.Naming", "CA1706:ShortAcronymsShouldBeUppercase")> _
Public Class DbOutdatedSyncException
    Inherits DbSyncException
'用途
Dim instance As DbOutdatedSyncException
[SerializableAttribute] 
[SuppressMessageAttribute("Microsoft.Naming", "CA1706:ShortAcronymsShouldBeUppercase")] 
public class DbOutdatedSyncException : DbSyncException
[SerializableAttribute] 
[SuppressMessageAttribute(L"Microsoft.Naming", L"CA1706:ShortAcronymsShouldBeUppercase")] 
public ref class DbOutdatedSyncException : public DbSyncException
/** @attribute SerializableAttribute() */ 
/** @attribute SuppressMessageAttribute("Microsoft.Naming", "CA1706:ShortAcronymsShouldBeUppercase") */ 
public class DbOutdatedSyncException extends DbSyncException
SerializableAttribute 
SuppressMessageAttribute("Microsoft.Naming", "CA1706:ShortAcronymsShouldBeUppercase") 
public class DbOutdatedSyncException extends DbSyncException

範例

下列程式碼範例會同步處理三個對等,並處理 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

繼承階層

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

執行緒安全性

任何公用靜態 (共用 在 Visual Basic) 此型別的成員具備執行緒安全。不保證任何執行個體成員安全執行緒。

請參閱

參考

DbOutdatedSyncException 成員
Microsoft.Synchronization.Data 命名空間