DBUtils.BatchUpdate调用报错
金蝶云社区-风雨起
风雨起
0人赞赏了该文章 895次浏览 未经作者许可,禁止转载编辑于2016年03月24日 14:43:06

大批量更新数据报错,报错信息如下:
异常发生Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
at System.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync()
at System.Data.SqlClient.TdsParserStateObject.TryReadNetworkPacket()
at System.Data.SqlClient.TdsParserStateObject.TryPrepareBuffer()
at System.Data.SqlClient.TdsParserStateObject.TryReadByte(Byte& value)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Kingdee.BOS.App.Data.Sql.SqlDatabase.DoBatchExecute(BatchSqlParam param, String where, StringBuilder sql, String tempTabAliases)
at Kingdee.BOS.App.Data.Sql.SqlDatabase.BatchUpdate(BatchSqlParam param, String where)
at Kingdee.BOS.App.Data.DBUtils.BatchUpdate(Context ctx, BatchSqlParam param, String where)

数据量级约在1W-2W左右

求大神支援,初步估计是因为SqlCommand.CommandTimeout 设置时间不够,但不清楚DBUtils是否会进行再次设置,往大神指教