Transaction Handling

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
calvinlo
Participant
Posts: 31
Joined: Thu Jul 17, 2003 2:55 am

Transaction Handling

Post by calvinlo »

Hi all,

I have a server job with one input, one transformer and two outputs for two tables. I would like to know how DataStage handle transaction. e.g. If one of the table fails to insert, could it rollback two tables?? can i make it one single transaction?
I am using DB2.

Thanks,
Cal
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
what is your specific configuration?

In General,
Each stage is an independant connection to the DB,
hence there is no real way to bind the 2 in the same transaction using the graphic GUI.
(I do Think, though I'm not sure, that there is a certain stage which you could use several links to the same stage and get what you need.)

in case you have staging area you don't really have a problem since a partial load won't be transfered to the production by you and an abort would be raised, you could then rerun the entire process again and only upon successfull run continue.

if you don't have a staging area:
what you could try is prepare ascii files and a single sql load script which will unite the 2 loads in the same transaction, a rollback in case any of the sql statements failed should be automatical (though you might need to find the exact syntax).

then you need to invoke a command line utility of your DB provider to load/bulk-load the file/s using the script you built.

Good Luck,

Roy R.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Roy - that 'certain stage' you mention are the Oracle OCI stages. They allow this functionality when multiple links come into a single OCI stage from the same transform. Note that the option (known as Transaction Grouping) *only* shows up in the above situation.

Are you sure this isn't an option for DB2?

-craig
calvinlo
Participant
Posts: 31
Joined: Thu Jul 17, 2003 2:55 am

Post by calvinlo »

I have staging tables and now it is the apply stage. Records in one table in staging table needs to populate into two tables in system of records. So not multiple links input to single stage, instead is one input to multiple stage.
Hope you all could help me.

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

Post by ray.wurlod »

You don't get transaction grouping with multiple stages. You can only get transaction grouping with multiple inputs into the same passive (for example ODBC) stage.
You can have multiple outputs from a Transformer stage running into the same passive stage.

+------+ +------+
| | -----> | |
----->| Tfmr | -----> | ODBC |
| | -----> | |
+------+ +------+


Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
calvinlo
Participant
Posts: 31
Joined: Thu Jul 17, 2003 2:55 am

Post by calvinlo »

Thanks.
But there are many cases that data from staging table populate to several tables in SoR. How can i handle this?

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

Post by ray.wurlod »

The table name is a property of the link, not of the stage.
A stage connects to a database instance. A link connects to a table.
Post Reply