Zack Turnbow


I've been getting the error below inconsistently when kicking SSIS packages off from a custom windows service. This same service works fine on our development and integration servers but not on our production servers. When I run the packages manually, it works great. Can someone provide any insight as to what is going on

Error:

The variable "System::LocaleID" is already on the read list. A variable may only be added once to either the read lock list or the write lock list.

I have tired the soultions found in http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=211081&SiteID=1 and applied the hotfix http://support.microsoft.com/kb/918091

I'm running SQL Server 2005 on Windows Server 2003 R2 SP2.

Thanks in advance





Re: The variable "System::LocaleID" is already on the read list.

Phil Brammer


What version of SQL Server 2005 RTM SP1 SP2








Re: The variable "System::LocaleID" is already on the read list.

lumbule

It would be SP2.







Re: The variable "System::LocaleID" is already on the read list.

Phil Brammer

Did you by chance copy packages as a foundation for creating other packages Or of all the packages you execute with your custom service, were they all created from scratch





Re: The variable "System::LocaleID" is already on the read list.

lumbule

I did copy and paste on a few packages and I regenerated the IDs. That didn't help, so I went back and re-created the problem packages from scratch. That didn't work as well.






Re: The variable "System::LocaleID" is already on the read list.

Phil Brammer

lumbule wrote:

I did copy and paste on a few packages and I regenerated the IDs. That didn't help, so I went back and re-created the problem packages from scratch. That didn't work as well.



That's where I was headed...

Can you be in a situation where a given package is still running when the "custom service" comes around again and executes the package

Another question. How are you executing the packages from within your service





Re: The variable "System::LocaleID" is already on the read list.

lumbule

What's going on is the service is polling a network folder for new XML files. Depending on the file name, I kickoff the appropriate package(s) to import the data in the XML files. I currently have a 2 second minimum up to 6 second maximum wait time from when a package runs and the next one begins.

Here is an example of the code.

Dim pkg As String = "C:\SSIS\Package1.dtsx"

Dim app As Microsoft.SqlServer.Dts.Runtime.Application = New Microsoft.SqlServer.Dts.Runtime.Application()

Dim p As Microsoft.SqlServer.Dts.Runtime.Package = app.LoadPackage(pkg, Nothing)

p.Variables("File").Value = finfo.FullName

p.Execute(Nothing, Nothing, eventListener, Nothing, Nothing)

System.Threading.Thread.Sleep(2000)

Dim pkg1 As String = "C:\SSIS\Package2.dtsx"

Dim app1 As Microsoft.SqlServer.Dts.Runtime.Application = New Microsoft.SqlServer.Dts.Runtime.Application()

Dim p1 As Microsoft.SqlServer.Dts.Runtime.Package = app1.LoadPackage(pkg1, Nothing)

p1.Variables("File").Value = finfo.FullName

p1.Execute(Nothing, Nothing, eventListener, Nothing, Nothing)






Re: The variable "System::LocaleID" is already on the read list.

Phil Brammer

[Microsoft follow-up]





Re: The variable "System::LocaleID" is already on the read list.

Cho Yeung - msft

Is the error post by Exec SQL Task or Dataflow task





Re: The variable "System::LocaleID" is already on the read list.

lumbule

Its a Dataflow task.






Re: The variable "System::LocaleID" is already on the read list.

Cho Yeung - msft

After looking at the codes, I think this is caused by a race condition in our codes. I don't think the problem will happen consistently. Can you file a bug for this Thanks





Re: The variable "System::LocaleID" is already on the read list.

Phil Brammer

Cho Yeung - msft wrote:
After looking at the codes, I think this is caused by a race condition in our codes. I don't think the problem will happen consistently. Can you file a bug for this Thanks



Zach, per Cho above, please file a bug at http://connect.microsoft.com/sqlserver/feedback and report back here with the link to your submission.

Thanks,
Phil





Re: The variable "System::LocaleID" is already on the read list.

Matt Masson - MSFT

There are also some threading considerations when executing packages from custom code. Make sure your application is running in the multiple thread apartment (MTAThread).






Re: The variable "System::LocaleID" is already on the read list.


Re: The variable "System::LocaleID" is already on the read list.

Zack Turnbow

Yeah, I made sure I had the thread set to MTAThread. Thankl you pointing that out.