MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Trigger mechanism to write to MQ When a row is inserted Db2

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
analyst
Beginner


Joined: 10 May 2007
Posts: 11
Topics: 8

PostPosted: Wed Mar 31, 2010 7:14 am    Post subject: Trigger mechanism to write to MQ When a row is inserted Db2 Reply with quote

I need design help in the following case:

I am writing records into DB2 Table from different transactions.Once the records are written into a table I need to put that data into MQ Message on real time basis..means whenver a new record is inserted into the table I need to run my batch process.Say for exapmle there is no record inserted for 2 hours I do not want to run that batch job for that period..What is the best way of doing this..

we are using TWS as the scheduler..is there any job trigger possible based on the insert record into DB2 table?? Any ideas about the best design..
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Wed Mar 31, 2010 8:29 am    Post subject: Reply with quote

Quote:
is there any job trigger possible based on the insert record into DB2 table?


any triggering mechanism based on a DB2 INSERT would involved extra load on DB2, which you do not want to do.

before offering any suggestions, have 1 question:

how involved is the batch job? 1 step/program or several?
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
RonB
Beginner


Joined: 02 Dec 2002
Posts: 93
Topics: 0
Location: Orlando, FL

PostPosted: Wed Mar 31, 2010 10:13 am    Post subject: Reply with quote

Why initiate a batch process when your requirement is to put the data into an MQ message on a real-time basis? Why not just post a message into the MQ from within the same program that does the DB2 insert, and be done with it?
_________________
A computer once beat me at chess, but it was no match for me at kick boxing.
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Wed Mar 31, 2010 10:21 am    Post subject: Reply with quote

Ron,
could be the db2 insert is done in cics and the 'batch process' is rather long or involved.

he already said his communication mechanism would be MQ (from db2 insert to batch process - what ever that is) and he would be writing the msg from the same module/process that does the db2 insert.

his problem is how to kick off the batch job to process the mq msg.
there are several alternatives - based on the complexity/size of the batch job,
a good solution can be provided,
but an understanding of the batch process is necessary.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Wed Mar 31, 2010 10:57 am    Post subject: Reply with quote

One method is an MQ "trigger monitor" program running as a started task. It can watch the queue and issue an MVS console command to submit the batch job as messages arrive. You can buy a trigger monitor program or write your own.
_________________
Regards,
Bill Dennis

Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity.
Back to top
View user's profile Send private message
RonB
Beginner


Joined: 02 Dec 2002
Posts: 93
Topics: 0
Location: Orlando, FL

PostPosted: Wed Mar 31, 2010 2:03 pm    Post subject: Reply with quote

dbzTHEdinosauer wrote:
he already said his communication mechanism would be MQ (from db2 insert to batch process - what ever that is) and he would be writing the msg from the same module/process that does the db2 insert.

It appears that your interpretation of what he "said" differs from my interpretation. From his statement that he "NEED[s] to put that data into MQ message on real time basis...MEANS whenever a new record is inserted into the table [he] need[s] to run [his] batch process", combined with the thread title (i.e. Triggermechanism to write into MQ When a row is inserted Db2 ), I inferred that he was looking for a way to trigger the batch process ( to do the insert ), on a real-time basis, whenever an insert to the DB2 table occurred ( regardless of which, of perhaps several, program(s) actually does the insert ). Hence my suggestion that he post the MQ message from the inserting program. I failed to mention what Bill posted - namely that an MQ trigger monitor program kick off whatever the OP hoped to accomplish following the posting of the MQ message.
Back to top
View user's profile Send private message
analyst
Beginner


Joined: 10 May 2007
Posts: 11
Topics: 8

PostPosted: Wed Mar 31, 2010 7:12 pm    Post subject: Reply with quote

dbz..My batch process is a single program,but it does lot of calculations but it is a single program/job ..Thanks for the load information .[Db2 trigger is an extra load]

Ron: Different IMS DC (DB2) and ADF transactions say around 20 are putting the messages into DB2 table..currently we do not have transactions which are putting data into MQ.If you have already done could you please confirm this..I am checking this with IMS DBA after this..That will be solution to my problem.

Bill..Once a message is put into MQ..the TRIGINT parametrer triggers the Batch job..this mechanism is fine and currently working..If IMS transaction can put the message into MQ that will solve my problem completely,but need to use 2 MQ Qs..that is fine.

Thank you very much for your replies..

By IMS transaction if I can not put the msg into MQ then I can only insert that data into a DB2 table.I need to process the data in the table and need to send it to MQ.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group