我试图在同一个表上提供一些范围来同步表中的不同数据集。配置运行良好,没有错误。但是,当我进行同步时,对 SyncOrchestrator.Synchronize() 的调用会超时。
当我只同步一个范围时,似乎所有数据都在同步,而不仅仅是范围过滤器定义的数据。
这是我的其中一个范围的配置代码。每个作用域都在单独的线程中运行,以便它们同时同步。
服务器配置:
var remoteLogVariableScopeDescription = new DbSyncScopeDescription(string.Format("{0}_{1}", DatabaseID, scopeName));
remoteLogVariableScopeDescription.Tables.Add(SqlCeSyncDescriptionBuilder.GetDescriptionForTable("TableName", localConnection));
var remoteDatabaseConfiguration = new SqlSyncScopeProvisioning(remoteConnection, remoteLogVariableScopeDescription);
remoteDatabaseConfiguration.ObjectPrefix = string.Format("Sync_{0}", scopeName);
remoteDatabaseConfiguration.Tables["TableName"].AddFilterColumn("Time);
remoteDatabaseConfiguration.Tables["TableName"].FilterClause = [side].Time >= DATEADD(minute, -1, GETDATE());
remoteDatabaseConfiguration.SetCreateTableDefault(DbSyncCreationOption.Skip);
remoteDatabaseConfiguration.SetUseBulkProceduresDefault(true);
remoteDatabaseConfiguration.CommandTimeout = 30;
remoteDatabaseConfiguration.Apply()
本地供应:
DbSyncScopeDescription localFrequentScopeDescription = SqlSyncDescriptionBuilder.GetDescriptionForScope(string.Format("{0}_{1}", DatabaseID, scopeName), string.Format("Sync_{0}", scopeName), remoteConnection);
var localDatabaseConfiguration = new SqlCeSyncScopeProvisioning(localConnection, localFrequentScopeDescription);
localDatabaseConfiguration.ObjectPrefix = string.Format("Sync_{0}", scopeName);
localDatabaseConfiguration.SetCreateTableDefault(DbSyncCreationOption.Skip);
localDatabaseConfiguration.Apply();
我的问题是:我提供的范围过滤器是否可行?您可以同时在同一张表上运行多个范围吗?
提前感谢您的帮助!