释放对“执行流程任务"中使用的变量的锁定| SSIS [英] Release Lock on variables used in Execute Process Task | SSIS

查看:67
本文介绍了释放对“执行流程任务"中使用的变量的锁定| SSIS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个软件包,其中 Foreach容器执行流程任务放在 ForEach容器中.在执行流程任务中发生某些错误时,它会重定向到 ForEach Container OnError 事件处理程序.

I have a package with a Foreach Container and Execute Process Task inside ForEach Container . On some error in Execute Process Task it redirects to OnError Event handler of ForEach Container.

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

I am capturing the Error from .exe using StandardErrorvariable property of the Task and using this in the script task which is present in OnError Event Handler.

脚本任务失败说

错误:尝试锁定变量时检测到死锁 "User :: ErrorExcelName,User :: ErrorFolder,User :: ErrorMessage, User :: FileName用于读取访问权限.16后无法获取锁定 尝试并超时.

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属性添加变量.

You can easily resolve the problem by managing the variable locking explicitly in code. (Not adding variables to ReadOnlyVariables and ReadWriteVariables properties.

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

参考

  • http://www.sqlis.com/sqlis/post/A-deadlock-was-detected-while-trying-to-lock-variables-in-SSIS.aspx
  • http://sqlblogcasts.com/blogs/mohitnayyar/archive/2007/09/23/update-ssis-deadlock-was-detected-while-trying-to-lock-variables-mohit-nayyar.aspx

这篇关于释放对“执行流程任务"中使用的变量的锁定| SSIS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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