重现步骤

[步骤]

(@CustomerID int,@SetPurchaseType int,@WhePurchaseType int,@OrderSourceType int,@WareHouseID int)UPDATE RB_OrderList                                      SET    PurchaseType = @SetPurchaseType,                                             P_Code_Time = Getdate()                                      FROM   RB_OrderList l WITH(nolock)                                             INNER JOIN RB_OrderInfo o WITH(nolock)                                               ON l.OrderCode = o.OrderCode                                                  AND l.CustomerID = o.CustomerID                                             INNER JOIN RB_OrderSource s WITH(nolock)                                               ON o.OrderSourceID = s.ID                                                  AND o.CustomerID = s.CustomerID                                      WHERE  l.PurchaseType = @WhePurchaseType                                             AND l.CustomerID = @CustomerID                                             AND s.OrderSourceType <> @OrderSourceType                                             AND o.WareHouseID = @WareHouseID 


[结果]


[期望]

提升性能 减少阻塞


历史记录  
  1. 2024-10-15 10:10:36, 由 袁慧斌 创建。
  2. 2024-10-15 11:03:55, 由 李乐同 指派给 程伟。
    修改了 指派给,旧值为 "liletong",新值为 "chengwei"。
  3. 2024-10-15 11:05:19, 由 袁慧斌 编辑。
    修改了 解决时效,旧值为 "0",新值为 "-1"。

    找到了一个之前的 例子


    CODE:N1007071

    Error:21_596_1_-2146232060

    SQL:UPDATE RB_OrderList

                                    SET    PurchaseType = @SetPurchaseType,

                                           P_Code_Time = Getdate()

                                    FROM   RB_OrderList l WITH(nolock)

                                           INNER JOIN RB_OrderInfo o WITH(nolock)

                                             ON l.OrderCode = o.OrderCode

                                                AND l.CustomerID = o.CustomerID

                                           INNER JOIN RB_OrderSource s WITH(nolock)

                                             ON o.OrderSourceID = s.ID

                                                AND o.CustomerID = s.CustomerID   WHERE l.PurchaseType = @WhePurchaseType and l.CustomerID=@CustomerID and (s.OrderSourceType=@OrderSourceType or IsASingleInTheEnd = 1) 

                                    AND (o.OrderStatus In(0,4) and o.WareHouseID=@WareHouseID) AND l.AddTime >=@AddTime

    PARAMS:@CustomerID = 1 ,@SetPurchaseType = 1 ,@WhePurchaseType = 0 ,@OrderSourceType = 20 ,@WareHouseID = 333 ,@AddTime = 2024/7/11 0:00:00 ,

    MESSAGE:Cannot continue the execution because the session is in the kill state.

    当前命令发生了严重错误。应放弃任何可能产生的结果。

    TRACE:   在 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)

       在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)

       在 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)

       在 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)

       在 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)

       在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)

       在 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)

       在 System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

       在 RB.DAL.DBOperator.ExecuteSql(String SQLString, SqlCommand cmd, Int32 Times, SqlParameter[] cmdParms)   在 RB.DAL.DBOperator.toCommonTipException(SqlException ex, String sql, SqlParameter[] cmdParms)

       在 RB.DAL.DBOperator.ExecuteSql(String SQLString, SqlCommand cmd, Int32 Times, SqlParameter[] cmdParms)

       在 RB.DALExtend.RB_OrderListExtend.UpdateProcurementListPurchaseTypeByIsStock(CM_UpdateProcurementListPurchaseTypeParam param)

       在 Biz.Irobotbox.Procurement.ProcurementBuildBKService.ProcurementBuildBK(Int32 customerID, String configProcurementGuid, String procurementGuid, Int32 adminID, String adminName, Int32 warehouseID, String skuAndnum, String messageInfo, String batchId)

       在 PandaBuy.ERP.Web.ASHX.IrobotBox.RB_ProcurementHandler.ProcessRequest(HttpContext context)

       在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

       在 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)

       在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

       在 System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)

       在 System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)

       在 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)

       在 System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)

       在 System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)

       在 System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)

       在 System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)

       在 System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)

       在 System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)

  4. 2024-10-15 11:40:26, 由 程伟 指派给 唐飞飞。
    修改了 指派给,旧值为 "chengwei",新值为 "tangfeifei"。

  5. 2024-10-15 11:40:39, 由 程伟 指派给 何建宝。
    修改了 指派给,旧值为 "tangfeifei",新值为 "hejianbao"。
  6. 2024-10-15 11:57:15, 由 何建宝 解决,方案为 重复BUG #52296 性能优化-订单相关业务更新 导致大量阻塞 超时 。
    修改了 解决方案,旧值为 "",新值为 "duplicate"。
    修改了 重复ID ,旧值为 "0",新值为 "52296"。
    修改了 解决版本,旧值为 "",新值为 "trunk"。
    修改了 解决日期,旧值为 "",新值为 "2024-10-15 11:56:25"。
    修改了 指派给 ,旧值为 "hejianbao",新值为 "yuanhuibin"。
    修改了 Bug状态 ,旧值为 "active",新值为 "resolved"。
    修改了 是否确认,旧值为 "0",新值为 "1"。
    修改了 解决者 ,旧值为 "",新值为 "hejianbao"。

    重复Bug已有需求来处理,排入到计划里面了

    https://pm.zhcxkj.com/zentao/story-view-24101.html

  7. 2024-10-16 09:25:50, 由 袁慧斌 指派给 李乐同。
    修改了 指派给,旧值为 "yuanhuibin",新值为 "liletong"。
    请备注测试责任人
  8. 2024-10-16 09:35:15, 由 李乐同 编辑。
    修改了 测试责任人,旧值为 "",新值为 "pengzhangquan"。
    修改了 解决时效 ,旧值为 "0",新值为 "1.76"。
    修改了 指派给 ,旧值为 "liletong",新值为 "yuanhuibin"。
    修改了 上线时效 ,旧值为 "-1",新值为 "17749714.18"。
  9. 2024-10-16 11:01:19, 由 袁慧斌 关闭。
    修改了 Bug状态 ,旧值为 "resolved",新值为 "closed"。
    修改了 指派给 ,旧值为 "yuanhuibin",新值为 "closed"。
    修改了 由谁关闭,旧值为 "",新值为 "yuanhuibin"。
    修改了 关闭日期,旧值为 "",新值为 "2024-10-16 11:01:19"。
所属项目 技术中心-需求池
所属模块 供应链   仓储物流   备库订单
所属计划
所属迭代
Bug类型
严重程度 一般
优先级 P0
Bug状态 已关闭
业务部门
影响功能
开发责任人 何建宝
测试责任人 彭章权
解决时效 1.76
激活次数 0
激活日期
是否确认 是
当前指派 Closed 于 2024-10-16 11:01:19
截止日期 0000-00-00
上线时间 0000-00-00 00:00:00
上线时效 17749700
操作系统
浏览器
关键词
抄送给
所属迭代
相关需求
相关任务
由谁创建 袁慧斌 于 2024-10-15 10:10:36
影响环境 577
由谁解决 何建宝 于 2024-10-15 11:56:25
解决版本 主干
解决方案 重复BUG #52296:性能优化-订单相关业务更新 导致大量阻塞 超时
由谁关闭 袁慧斌 于 2024-10-16 11:01:19
最后修改 袁慧斌 于 2024-10-16 11:01:19
相关Bug