Rollback in DRS stage

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
mohanraj
Participant
Posts: 48
Joined: Sat Mar 25, 2006 12:40 am
Location: bangalore

Rollback in DRS stage

Post by mohanraj »

hi to all

Can anyone explain me how can I do rollback in DRS stage.
My problem is like this.Suppose my source contains 100 records and my job get abort after 50 records.But I don't want these passed 50 records to be seen in my target table and my target is DRS is that possible.

Thanks in advance
Mohan
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post by loveojha2 »

Set your transaction size to zero.
Success consists of getting up just one more time than you fall.
ameyvaidya
Charter Member
Charter Member
Posts: 166
Joined: Wed Mar 16, 2005 6:52 am
Location: Mumbai, India

Post by ameyvaidya »

Or Split your job into 2 jobs:
the first does all the validations and writes the output to a sequential file
the second reads the file and loads the database.

The first job can then abort without any evil consequences.
Amey Vaidya<i>
I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.</i>
<i>- Douglas Adams</i>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or just set the transaction size to zero. :wink:

That turns your load into an 'all or nothing' load and the records are only commited once at the end if the job completes without fatal errors. In other words, the job must abort for the rollback to occur. This means running the job with a very low Warning threshold or enabling the 'Treat warnings as fatal' option in the stage if available.

No evil consequences here either, if done properly.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ameyvaidya
Charter Member
Charter Member
Posts: 166
Joined: Wed Mar 16, 2005 6:52 am
Location: Mumbai, India

Post by ameyvaidya »

absolutely .. i agree.. but i recall reading a comment here about it being good job design to disconnect" the transform and the load parts of a "job" (But considering my non-existent short term memory, i might be wrong :oops:).
Amey Vaidya<i>
I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.</i>
<i>- Douglas Adams</i>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

True... your advise to 'disconnect' the two processes is perfectly valid, which I should have mentioned. Regardless, I'd still use those commit settings on the portion that does the actual database work.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply