Page 1 of 1

DB2 UDB API stage does not rollback

Posted: Thu Nov 22, 2007 2:59 pm
by michaeld
I am trying to make DB2 UDB API stage rollback when there is bad data that gets rejected by DB2, but it does not. It just creates a warning and continues inserting the rest of the records.

For examlpe out of 200 records 10 have a bad date. DB2 inserts 190 instread of rolling back to the last successful transaction.

I did this by tring to insert an invalid date to a DB2 table. Instead of aborting the job and rolling back the records that were part of the same array, it just raises a warning and keeps going without rolling back.

Is this a DB2 UDB API stage bug or a setting in the CLI Driver? Any ideas on how to get this to work?

Array size: 50
Transaction commit size: 50
Number of records processed: 200
Driver: [IBM][CLI Driver][DB2/NT]

:?:

Posted: Thu Nov 22, 2007 5:20 pm
by ray.wurlod
(From memory) isn't there a "treat warning as fatal" property or something similarly named? A "fatal" will issue a rollback in addition to aborting the job.

Posted: Thu Nov 22, 2007 6:28 pm
by michaeld
I looked for something like that and all I found is the "abort after X warnings" setting when you run a job. But when I set it to 1 then it added an error entry to the log, but the job continued and finished with a status of "Finish with warnings".

I also thought that a message handler might be able to promote it to an error, but it can't. It can only demote it to informational.

thanks for the tip thought. I'll keep looking.

Posted: Thu Nov 22, 2007 11:09 pm
by aakashahuja
Or you can set your job to abort as soon as it gets a warning.

Posted: Thu Nov 22, 2007 11:10 pm
by aakashahuja
Or you can set your job to abort as soon as it gets a warning.

Posted: Fri Nov 23, 2007 9:07 am
by michaeld
how do I do that?

If it's in the limits section when you run the job then it doesn't seem to work. It puts in a Fatal entry to the log and it continues processing.