2012-07-12 55 views
1

我有服務器上的數據庫 - 的Microsoft SQL Server 2008 R2(RTM) - 10.50.1600.1(X64)。 配置爲使用Microsoft同步服務的ADO.NET通過WCF一個SQL Server Compact數據庫客戶端進行同步。錯誤在SQL Server數據庫同步使用SyncServices和WCF

有時這種錯誤開始浮出水面:每次

Microsoft.Synchronization.Data.SyncException: Unable to enumerate changes at the DbServerSyncProvider for table 'TABLE NAME' in synchronization group 'GROUP NAME'.

---> System.Data.SqlClient.SqlException: A transport-level error has occurred when receiving results from the server (provider: TCP Provider, error: 0 - The semaphore timeout period has expired.)

at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket()
at System.Data.SqlClient.TdsParserStateObject.ReadBuffer()
at System.Data.SqlClient.TdsParserStateObject.ReadByte()
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
at Microsoft.Synchronization.Data.Server.DbServerSyncProvider.EnumerateChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession, IDbTransaction transaction, EnumerateChangeType changeType, SyncSchema traceSchema)

表名稱不同。

請告訴我如何解決這個問題。

謝謝。

回答

2

我相信,如果你還沒有在你的數據庫上指定的保留期限進行了成功的同步,你會得到這個錯誤。見this link

我們也得到這個偶爾會在同步過程中無法獲取的數據,由於打開的事務或者從另一個進程鎖定。 (我相信修復這是SET READ_COMMITTED_SNAPSHOT ON

ALTER DATABASE yourdatabasenamehere 
SET READ_COMMITTED_SNAPSHOT ON 

GO 
)