gpt4 book ai didi

sql-server - 释放对执行流程任务中使用的变量的锁定 | SSIS

转载 作者:行者123 更新时间:2023-12-03 23:05:48 24 4
gpt4 key购买 nike

我有一个包,里面有一个 Foreach ContainerExecute Process Task inside ForEach Container 。在执行流程任务中出现某些错误时,它会重定向到 ForEach ContainerOnError 事件处理程序。

我使用任务的 StandardErrorvariable 属性从 .exe 捕获错误,并在 OnError 事件处理程序中的脚本任务中使用它。

脚本任务失败说

Error: A deadlock was detected while trying to lock variable "User::ErrorExcelName, User::ErrorFolder, User::ErrorMessage, User::FileName" for read access. A lock could not be acquired after 16 attempts and timed out.

如何解决这个问题?

最佳答案

您可以通过在代码中显式管理变量锁定来轻松解决问题。 (不向 ReadOnlyVariablesReadWriteVariables 属性添加变量。

string strFilename;
Variables lockedVariables = null;
Dts.VariableDispenser.LockOneForRead("FileName", ref lockedVariables);
strFilename = lockedVariables["FileName"].Value;
lockedVariables.Unlock();

引用资料

关于sql-server - 释放对执行流程任务中使用的变量的锁定 | SSIS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44453384/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com