dbTalk Databases Forums  

Problem passing dictionary as argument

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Problem passing dictionary as argument in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
JRStern
 
Posts: n/a

Default Problem passing dictionary as argument - 05-25-2005 , 01:37 PM






OK, wrote a DTS package that has multiple ActiveX steps.

In an early step I create and populate a dictionary object, create a
new global variable on the fly and set its value to the dict, and then
fetch the value from the global in later steps and use the values. It
all worked fine until ...

That is, it worked fine when the package was run directly under my
login. When I set it to run as a job under our local sql.admin
account, it failed. Huh? If I log into the system as sql.admin and
run the package locally, still OK. Only when run as a job and under
sql.admin does it fail (I have not tried running it as a job under
another login, that isn't really an option).

When I do a "set dict = DTSGlobalVariables("mydict").value", it gets
*something*, if passes a "is nothing" test, but I get an error as soon
as I try to reference so much as the count.

Well, right now I'm busy rewriting the code around this glitch, but of
course I'd rather understand it and fix it.

Any help?

It doesn't seem to be the problem in q298725, because a ton of other
objects are still created and operate correctly.

Thanks.

Josh


Reply With Quote
  #2  
Old   
Helge C. Rutz
 
Posts: n/a

Default Re: Problem passing dictionary as argument - 05-25-2005 , 02:16 PM






Hi Josh,

"JRStern" wrote:
Quote:
OK, wrote a DTS package that has multiple ActiveX steps.
In an early step I create and populate a dictionary object, create a
new global variable on the fly and set its value to the dict, and then
fetch the value from the global in later steps and use the values. It
all worked fine until ...
That is, it worked fine when the package was run directly under my
login. When I set it to run as a job under our local sql.admin
account, it failed. Huh? If I log into the system as sql.admin and
run the package locally, still OK. Only when run as a job and under
sql.admin does it fail (I have not tried running it as a job under
another login, that isn't really an option).
When I do a "set dict = DTSGlobalVariables("mydict").value", it gets
*something*, if passes a "is nothing" test, but I get an error as soon
as I try to reference so much as the count.
Well, right now I'm busy rewriting the code around this glitch, but of
course I'd rather understand it and fix it.
Any help?
It doesn't seem to be the problem in q298725, because a ton of other
objects are still created and operate correctly.
I'm not absolutly sure what you do, and why the error happens but I have
maybee a hint.
AFAIK the dictionary object is not designed for multithreaded applications.
Have you tried do define the "run on main package threat" option for all
tasks using this object to avoid threading conflicts?
Can you run this package interactivly and with DTSRUN?

Helge



Reply With Quote
  #3  
Old   
JRStern
 
Posts: n/a

Default Re: Problem passing dictionary as argument - 05-25-2005 , 03:10 PM



On Wed, 25 May 2005 21:16:08 +0200, "Helge C. Rutz"
<news050424 (AT) nurfuerspam (DOT) de> wrote:
Quote:
I'm not absolutly sure what you do, and why the error happens but I have
maybee a hint.
AFAIK the dictionary object is not designed for multithreaded applications.
Have you tried do define the "run on main package threat" option for all
tasks using this object to avoid threading conflicts?
Helge, I believe you have done it! That seems to work!

Why it works fine interactively but not in a job is still a mystery,
but it's one I can live with. I set those tasks to run on the main
thread, and actually set the parallel down to 1 also, and it ran
through!

A million thanks!

Josh



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.