Release Lock for Variables Used in Execution Task Execution | SSIS

I have a package with a Foreach Container and Run a process task inside a ForEach container . On some error in the Execute Process Task, it is redirected to the OnError event handler for the ForEach Container .

I am retrieving Error from .exe using the StandardErrorvariable property of the Tasks and using that in the task script that is present in the OnError event handler .

The script task is not responding

Error: Deadlock encountered while trying to lock the variable "User :: ErrorExcelName, User :: ErrorFolder, User :: ErrorMessage, User :: FileName" for read access. The lock cannot be obtained after 16 attempts and timeout.

How to fix it?

+2


source to share


1 answer


You can easily fix the problem by manipulating explicit variable locking in your code. (Without adding variables to properties ReadOnlyVariables

and ReadWriteVariables

.

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

      



Links

0


source







All Articles