Numeric.sequence per Job

One Star

Numeric.sequence per Job

Hi,
my JobA calls JobB via a tRunJob.
Within JobB, I've got a tJava where I call Numeric.sequence.
Unfortunately Numeric.sequence starts only the first time I call JobB with 1. But I want it to start from 1 everytime I call JobB.
From JobA I call tRunJob (JobB) via a OnComponentOK (because it's a tJava which calls tRunJob) - is this ok?
Within JobB I use:
id = Numeric.sequence ("s1", 1, 1);

(but it's in a routine and get's called from the tJava)
Is it somehow possible to reset id after JobB finished?
I found this: http://www.talendforge.org/forum/viewtopic.php?id=3429 but I have a subJob, do I have to do it like this, too?
Thank you in advanced.
Bye, Chris
One Star

Re: Numeric.sequence per Job

Hi,
You can use the process id in the sequence name :
id = Numeric.sequence(pid, 1, 1);

It's explained here : http://www.talendforge.org/bugs/view.php?id=5665
Best regards,
Karine
One Star

Re: Numeric.sequence per Job

Hi Karine,
thank you for your reply.
Got it working now Smiley Happy