Monday, March 26, 2012

ERROR: A variable may only be added once to either the read lock list or the write lock list.

Hi,
I have set of 2 DTS packages, one of which calls the other by forming a command-line (dtexec) using a Execute Process task.

From the parent package-> Execute Process Task->
dtsexec /F etc... /<pkg variable> = "servername"

Each of the parent and the called package have a variable: "User::DWServerSQLInstance" which is mapped to the SQL server connection manager server name property using an expression. The outer package has the above variable and so does the inner called package (which gets assigned through the command line from the outerpackage call to inner)

I "sometimes" get the following error:

OnError,I4,TESTDOM\Administrator,ACDWAggregation,{A1F8E43F-15F1-4685-8C18-6866AB31E62B},{77B2F3C7-6756-46EB-8C01-D880598FB4B3},5/22/2006 5:10:28 PM,5/22/2006 5:10:28 PM,-1073659822,0x,The variable "User::DWServerSQLInstance" is already on the read list. A variable may only be added once to either the read lock list or the write lock list.

Help would be appreciated!

I have seen other posts on this but, not able to relate the solution to my scenario.

Do you have multiple tasks (in the same package) executing in parallel, and using same variable, e.g. in property mappings?

If yes, I think this problem is fixed by this post-SP1 fixes collection:
http://support.microsoft.com/Default.aspx?id=918222

Alternatively, you may change the package so the tasks are executed sequentially by creating precedence constraints.|||

Hi Brian,
The child Package uses the User Variable: DWSQLInstanceName mentioned above to initialize 4 SQL Server connections (2 OLEDB & 2 ADO .NET) -- Only <<Server Name>> property using expressions.

I also checked that this error seems to be only on Multi-proc machine. Don't get the same on my laptop.

I cannot seralize the tasks since, the error is coming @. package level while evaluating the package expressions (i.e. for the connections) when the package starts.

What is the best way to still use expressions for connection server names but, get around this error?
Is this what is fixed in SP1?

Also, it seems that the packages does not fail when it encounters the error which I am getting. I have MaxErrorCount = 1 for Package. The package goes ahead.

|||I believe the issue with connections sharing the variable is fixed in the commulative hotfix package I've mentioned above. It should be installed on top of SP1: first, install SP1 then install all the component packages from the hotfix package in the order they are listed in the article.

http://www.microsoft.com/downloads/details.aspx?FamilyId=CB6C71EA-D649-47FF-9176-E7CAC58FD4BC
and then
http://support.microsoft.com/Default.aspx?id=918222|||This was indeed a bug and the post SP1 hotfix "fixes" it.

However, you can still create the bug. It's harder but stil there...|||

Thanks Michael and Crispin for the help on this!

I think we will need to upgrade to SP1 and install the Hotfix bundle for SP1. I think this should fix the issue which I am facing i.e. use of same variable for setting connection "Server Name" - Property in the expressions.

Thanks,
Gaurav

No comments:

Post a Comment