We are running five jobs concurrently that execute the same batch Cobol
program to insert rows into the same DB2 table. The primary key is the
Current Time Stamp on the table. These jobs are abending with ?803 (SQL
code negative 803). We have become clueless why this was happening. Any
suggestion is greatly appreciated.
QUESTION POSED ON: 03 DEC 2004 QUESTION ANSWERED BY:
Craig Mullins
Well, you probably won't like the answer, but here goes. One (or more) of
the batch jobs is picking up the same exact timestamp value as one of the
other batch jobs. When that happens you are trying to insert a duplicate key
-- and the unique index prohibits that from happening.
If the -803s are not very common you should consider re-coding your programs
to re-execute the INSERT statement when it gets a -803. This will cause DB2
to pick up a new timestamp that will not conflict with the previous
timestamp value. However, it still could conflict with the other jobs. When
you implement this change in your code be sure to also include a counter for
the retries and abending only after 5 or 10 unsuccessful attempts.
Of course, it is possible that you just cannot run that many jobs at the
same time and avoid -803 problems. In that case you should consider either
reducing the number of concurrent jobs (to something less than 5) or
redesiging your database tables to use a different primary key.
Related Topics:
Search Advice from more than 250 TechTarget Experts
Your question may have already been answered! Browse or search more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice
ASSOCIATED RSS FEEDS

 |
 |
Expert Answer Center: Expert Q&As |
 |
View all RSS Feeds | RSS Info
|