KeyMgtGetNextValue & KeyMgtGetNextValueConcurrent
Moderators: chulett, rschirm, roy
KeyMgtGetNextValue & KeyMgtGetNextValueConcurrent
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
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
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
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)
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
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: