BulkInsertCommand在Sync Framework 2.1中失败 [英] BulkInsertCommand failed in Sync Framework 2.1

查看:75
本文介绍了BulkInsertCommand在Sync Framework 2.1中失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时,当尝试使用Sync Framework 2.1从SQL Express同步到SQL Server时,出现以下错误.客户端收到此错误后,他们必须重新初始化范围.像错误状态这样的语法不会有任何问题,因为它长时间运行没有问题(发生插入操作).有什么想法吗?

On occasion I get the following error when trying to synchronize from SQL Express to SQL Server using Sync Framework 2.1. Once a client gets this error they have to reinitialize the scope. There can't be anything wrong with the syntax like the error states because it runs no problem for long periods of time (with inserts happening). Any thoughts?

11:18:21 AM无法为表"XXX"执行命令"BulkInsertCommand";交易已回滚.确保命令语法正确.Microsoft.Synchronization上午11:18:21上午11:18:21,位于Microsoft.Synchronization.Data.ChangeHandlerBase.CheckZombieTransaction(String commandName,String table,Exception ex)

11:18:21 AM Failed to execute the command 'BulkInsertCommand' for table 'XXX'; the transaction was rolled back. Ensure that the command syntax is correct. 11:18:21 AM Microsoft.Synchronization 11:18:21 AM at Microsoft.Synchronization.Data.ChangeHandlerBase.CheckZombieTransaction(String commandName, String table, Exception ex)

从跟踪日志中:

警告,OfflineAgentMonitor.vshost,13,04/05/2011 11:16:17:224,批量命令BulkUpdateCommand失败,但出现以下异常.单次应用期间将重试行.System.Data.SqlClient.SqlException(0x80131904):尝试传递具有19列的表值参数,其中相应的用户定义表类型需要20列.

WARNING, OfflineAgentMonitor.vshost, 13, 04/05/2011 11:16:17:224, Bulk command BulkUpdateCommand failed with the following exception. Rows will be retried during single apply. System.Data.SqlClient.SqlException (0x80131904): Trying to pass a table-valued parameter with 19 column(s) where the corresponding user-defined table type requires 20 column(s).

推荐答案

尝试启用 Sync Fx跟踪,然后检查Sync Fx是否记录原始异常.如果我没记错的话,通常在数据库连接丢失时会引发异常.您应该可以重试同步,而无需重新配置范围.

try to enable Sync Fx tracing and check if Sync Fx logs the original exception. if i remember it right, the exception is normally raised when the db connection is lost. you should be able to retry the sync though without re-provisioning the scope.

这篇关于BulkInsertCommand在Sync Framework 2.1中失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆