Duplicate Surrogate Key

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
jerome_rajan
Premium Member
Premium Member
Posts: 376
Joined: Sat Jan 07, 2012 12:25 pm
Location: Piscataway

Duplicate Surrogate Key

Post by jerome_rajan »

Hi,
I'm not sure if this is a DataStage issue or a Database issue. I have a transformer that has 3 output links. Each output link uses the NextSurrogateKey() to generate a sequence key from an Oracle DB Sequence object. The upstream and downstream all execute in parallel.

I get erratic PK violation errors due to duplicate PK values. What could the reason be?
Jerome
Data Integration Consultant at AWS
Connect With Me On LinkedIn

Life is really simple, but we insist on making it complicated.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I'm going to guess it's a DataStage issue somehow as, to the best of my knowledge and experience, an Oracle sequence is not capable of issuing any kind of duplicate value. Not that Oracle ever has any bugs, of course. :wink:

In your shoes I'd start with your official support provider.
-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 »

Might the table be getting new rows from sources other than DataStage, and not updating the Oracle sequence?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jerome_rajan
Premium Member
Premium Member
Posts: 376
Joined: Sat Jan 07, 2012 12:25 pm
Location: Piscataway

Post by jerome_rajan »

Craig and Ray,
Thank you for the response.
We did a sanity check to ensure that there are no alternate processes trying to generate the key without the sequence. We even went so far as to tweak the security so that only the system id can insert rows into the table in question.
The only thing that has kept the error from popping up again is changing the execution mode to "Sequential" which led me to believe that the multiple threads accessing the sequence object are causing the conflict somehow. Though, as Craig rightly put, the Oracle sequence is "Incapable" of an anomaly like this
Jerome
Data Integration Consultant at AWS
Connect With Me On LinkedIn

Life is really simple, but we insist on making it complicated.
Post Reply