Page 1 of 1

Cannot run multiple instances of a job

Posted: Thu Mar 04, 2004 10:27 am
by sdupre
Hi everyone,

I absolutely cannot figure out how to run multiple instances of a job.

What I actually need to do is more complex than this example but for the sake of argument I made the simplest possible job I could think of and run multiple instances of it.

Here's what I did :

Created a job that reads lines from a file and copies it to another. That's it, it does nothing else and it works fine.
I obviously selected "allow multiple instance" in the job properties.

The input and output filenames are passed as parameters.

Now what I want to do is simultaneously run two instances of this job to work on totally different files.

I have a script that starts those jobs as follow :

dsjob -run -param p1="i1" -param p2="o1" myProject TEST_MULT &
dsjob -run -param p1="i2" -param p2="o2" myProject TEST_MULT &

In theory what this should do is the first job should read from i1 and write to o1 and the second job should read from i2 and write to o2.

It works fine when I run them sequentially but when I run them at the same time, I either get "Status code = -2 DSJE_BADSTATE" or "Status code = -10 DSJE_JOBLOCKED"

Is something misconfigured, is this a bug, or am I misunderstanding what "multiple instances" should do ??

Posted: Thu Mar 04, 2004 10:38 am
by sdupre
Did some more tests...

When I run 10 instances of this job, I get anywhere between 3 and 6 successes, it's never consistent.

seems buggy to me.

I'll log a support call I think.

Re: Cannot run multiple instances of a job

Posted: Thu Mar 04, 2004 10:47 am
by chulett
sdupre wrote:Is something misconfigured, is this a bug, or am I misunderstanding what "multiple instances" should do ??
You can't just simply start the same jobs multiple times. You need to start the job and specify a different Invocation ID for each run - this is what allows them to run simultaneously. For example:

Code: Select all

dsjob -run -param p1="i1" -param p2="o1" myProject TEST_MULT.o1
dsjob -run -param p1="i2" -param p2="o2" myProject TEST_MULT.o2
Note the extra dot and text at the end of the job name. This is the Invocation ID, which is user-defined. Check your online help for more on this subject.

FYI - There's no need to run these commands in the background. If you do not specify the -wait option then it will not wait for the job to finish before moving on to the next command.

Posted: Thu Mar 04, 2004 10:54 am
by sdupre
That worked. Thank you very much, you are a life saver.

Can you tell me where that syntax is documented ? I could not find it anywhere.

Posted: Thu Mar 04, 2004 11:03 am
by chulett
A good place to start is with the online help available from the Director. Bring up the Index entry for "Multiple Job Instances" and go from there!

Posted: Thu Mar 04, 2004 11:47 am
by kcbland
Go to your Start button and descend to the Ascential client software folder and then go to Online Documentation. Everything you could ever need is there.