Global Unit of Work - Or Read from MQ insert into Table

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
mark1024
Participant
Posts: 9
Joined: Mon Nov 07, 2011 12:23 pm

Global Unit of Work - Or Read from MQ insert into Table

Post by mark1024 »

I have a MQ job that reads MQ, parses the table name, then parses the columns for that table. I would like to only delete the msg off the MQ when the DB2 commits. delete (under transaction).

THe problem I am having is that if I get a resource unavilable on DB2 Side and get a sig int, then the commit does nto happen and the Message is still taken off MQ, because "Only local units of work are supported"

From the MQ Connectivity Guide.

Note: Global units of work cross MQ and RDBMS boundaries, such as reading a message, then performing an SQL insert. These global units of work are not currently supported. Only local units of work are currently supported.

Reading from MQ and inserting into a DB is excatly want I want to do within a transaction.

Any suggestions on how to do this? I read some blogs online, but not any good solutions.

--All coded up and nowhere to go.
Mark THomas
Data Architect
IBM GBS
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

...take a close look at the DTS Stage --- the Distributed Transaction Stage....it takes advantage of MQ's ability to perform the overall unit of work......so that......"if" you have things correctly configured in MQ to support a x-resource (XA) unit of work between MQ and DB2 or MQ and Oracle [ODBC came a long a little while ago also, as I recall], then the DTS stage will issue the appropriate calls to make it happen.....

...it's more complicated than that, with a work queue that "saves" the message at the source, as soon as you read it, under syncpoint, so that it is not lost, etc., but DTS is the place to start.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Post Reply