Same DB2 Seuuencer in mulitiple jobs

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
mary
Participant
Posts: 23
Joined: Fri Jun 02, 2006 1:28 am
Location: Bng

Same DB2 Seuuencer in mulitiple jobs

Post by mary »

Hi all,

If we use the same db2 sequencer to generate the primary key for the one table in multiple jobs which may run at the same time, will create any lock issue or duplicate number generation?

Thanks in Advance
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Maybe. But the locks aren't held for long, so maybe allowing each job to WAIT for any lock on the sequencer to be released would be a sufficient solution.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kvonhuene
Participant
Posts: 1
Joined: Thu Jan 10, 2008 2:06 pm

Re: Same DB2 Sequencer in mulitiple jobs

Post by kvonhuene »

The sequence object will not get locked, because the DB2 engine will not have any problem handling requests (function call "nextval"). Further, you cannot get duplicates from using "nextval". The only related concern is that the "prevval" function returns the last value without regard to which process got it.
Post Reply