KeyMgtGetNextValue & KeyMgtGetNextValueConcurrent

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
ds_is_fun
Premium Member
Premium Member
Posts: 194
Joined: Fri Jan 07, 2005 12:00 pm

KeyMgtGetNextValue & KeyMgtGetNextValueConcurrent

Post by ds_is_fun »

I want to get rid of sequence, next val calling from dB.
I have just performed a test and seems like I can perform it from these Ds routines as in the subject.
What usage of these functions would help me make these work exactly like dB sequences.
Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Only the ability to guarantee that no other process was updating the table using the sequence to generate keys at the same time as the DataStage job.

If there are other processes that update the table using the sequence at other times then the DataStage job, then you need to design in a check to retrieve the next available key into the sequence record maintained (in the SDKSequences hashed file) by these routines before processing more rows through DataStage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ds_is_fun
Premium Member
Premium Member
Posts: 194
Joined: Fri Jan 07, 2005 12:00 pm

Post by ds_is_fun »

What exactly is the difference between the above two routines.
An eg would be really helpful.
thx
Those who throw objects at crocodiles should be asked to retreive 'em.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The first holds a lock on the "sequence" for the duration of the job, so that only the job using it can generate keys. The second locks the sequence only for the duration of obtaining (and incrementing) the key value, so more than one job can generate keys from the same sequence at the same time. The first is more efficient - the second is needed in the particular circumstance described.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Double-click on them and read the Long Descriptions.
-craig

"You can never have too many knives" -- Logan Nine Fingers
udaysindu
Participant
Posts: 3
Joined: Sat Sep 22, 2007 9:38 pm
Location: hyderabad

Hi

Post by udaysindu »

First one generate surugate key when routines calls.
..
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Actually, they both do. The difference, as the name of the second implies, is concurrency. If that means nothing to you, check the Wiki link. The latter is meant to be used in a concurrent environment - where multiple processes could be working on the same resource at the same time. The former does not support that concept.

And as I posted earlier, the Long Description for each notes this. Double-click on the routines in the Manager to read that and the code where the differences should become clear. (actually, any routine)
KeyMgtGetNextValue wrote:"This routine does not support access to a particular sequence by more than one process concurrently."
KeyMgtGetNextValueConcurrent wrote:"a lock on the file prevents concurrent access"
-craig

"You can never have too many knives" -- Logan Nine Fingers
ds_is_fun
Premium Member
Premium Member
Posts: 194
Joined: Fri Jan 07, 2005 12:00 pm

Post by ds_is_fun »

How do we achieve the same key generation functionality in PX?
Im looking for generating keys pointing to a file that would store next val just like the these 2 routines in Server. Thx
Those who throw objects at crocodiles should be asked to retreive 'em.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

First by not hi-jacking this thread but by starting your own over in the PX forum. Secondly, read up on the Surrogate Key Generator stage. If you have specific question after that, post them in a new thread in the PX forum.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

See, one CAN hijack one's own thread!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply