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
Same DB2 Seuuencer in mulitiple jobs
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Re: Same DB2 Sequencer in mulitiple jobs
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.