如果合併式發行集包含許多文件和條件約束,SQL Server Compact 3.5 修正:"指定的值違反資料行或資料表的完整性條件約束 」 錯誤

Template: Generic Hotfix

BUG #: 149290 (Content Maintenance)VSTS Bug #: 767547

徵狀

請試想下列案例:

  • 您的電腦上安裝 Microsoft SQL Server Compact 3.5。

  • 您可以建立 「 訂閱者 」 在 SQL Server Compact 3.5。

  • 您下載多個資料列從合併式發行集資料庫與 「 訂閱者 」 的 「 發行者 」 同步時。 資料列包含許多文件和條件約束。

在這個案例中,SQL Server 錯誤記錄檔會記錄類似下列的錯誤訊息:

System.Data.SqlServerCe.SqlCeExceptionNative 錯誤 = 0,HRESULT =-2147217873,錯誤訊息: 指定的值違反資料行或資料表的完整性條件約束。

注意在 32 位元作業系統和 64 位元作業系統中,會發生這個問題。

This issue usually occurs when the following conditions are true:

  • The publisher synchronizes under a heavy workload.

  • The articles of rows are downloaded out of sequential order.


原因

無效的交換 ID 的使用,就會發生這個問題。當下載的多個資料列處於擱置狀態時,SQL 壓縮用戶端代理程式呼叫重試使用的方法,無效的交換 id。 因此,就會發生 < 徵狀=""> 一節所述的問題。

This issue occurs because the guidRetries value is not initialized to a GUID value.

Note The AddRetryMsg() method uses the guidRetries value to generate an exchange ID for a retry message.

When many articles and constraints exists, the AddRetryMsg() method may run multiple times. However, the guidRetries value is not initialize to a GUID value, and the guidRetries values are the same when the AddRetryMsg() method runs multiple times on a computer that is running a 32-bit operating system.

Therefore, SQL Compact Client Agent uses the same exchange ID to create all new requests, and an SSCE_M_RSCBWITHSAMEEXCHANGEID 29005 Server Agent error is generated. Additionally, you receive the following error message:

A replication session control block already exists. The IIS server was probably shut down during a synchronization process. Try synchronizing again.

解決方案

累積更新套件 5 中會包含 hotfix 可解決這個問題,SQL Server Compact 3.5 Service Pack 2 (SP2)。 如需有關如何取得累積更新套件 5,SQL Server Compact 3.5 sp2 的詳細資訊,請按一下下面的文件編號,檢視 「 Microsoft 知識庫 」 中的文件:

2553608 對於 SQL Server Compact 3.5 Service Pack 2 的累積更新 5

Author: jannaw
Writer: v-yipli
Tech Reviewer: panarasi;rtandon;ambrishm;babuk;atisagar;jannaw
Editor: v-lynan

Need more help?

Expand your skills
Explore Training
Get new features first
Join Microsoft Insiders

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.

×