Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

DB2 Commit

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Haresh

New User


Joined: 04 Jan 2009
Posts: 18
Location: Germany

PostPosted: Fri Mar 04, 2011 8:40 pm    Post subject: DB2 Commit
Reply with quote

Hello,

can anyone please tell me is there a way to start a cobol program whenever a commit occurs in a DB2 table?

Thanks in advance
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Mar 04, 2011 8:58 pm    Post subject:
Reply with quote

Hello,

What does "start a cobol program" mean for your question?

Depending on exactly what you are trying to accomplish, there are different answers.
Back to top
View user's profile Send private message
Haresh

New User


Joined: 04 Jan 2009
Posts: 18
Location: Germany

PostPosted: Fri Mar 04, 2011 9:05 pm    Post subject:
Reply with quote

my goal is to execute a cobol program automatically whenever a commit occurs in a DB2 table.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Mar 04, 2011 9:18 pm    Post subject:
Reply with quote

Hello,

Well, this is just a repeat of the original post. . . icon_sad.gif

You need to explain (in detail) what you want to accomplish. "Start a cobol program" tells nothing.

Where are you going to start this program? How should it communicate back to the process that "started" it? What if it fails?
Back to top
View user's profile Send private message
Haresh

New User


Joined: 04 Jan 2009
Posts: 18
Location: Germany

PostPosted: Fri Mar 04, 2011 10:10 pm    Post subject:
Reply with quote

Hello,

the cobol program and the db2 table are in the same LPAR. it is not required to communicate back to the process that has started this cobol program.

The error occurs in the cobol program will be handled via logging mechanism (log the error details in a file/table and read it later).

The error handling at the start process can be defined only if i know the process which is going to start the cobol program.

All these steps will not affect the source data since the complete process is after the commit of the source data.

please note that i havent done many posts, so i am still now sure how to use right words to explain my need.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Mar 04, 2011 10:17 pm    Post subject:
Reply with quote

warum muß Du sofort zugriff auf die Tabelle nach ein COMMIT.
Es macht keinen Sinn.

Hat es zu tun mit 'logging' oder 'duplexing transactions' oder 'mirror image trickle-down'.

You will receive little help
until you reveal the reason for 'starting a process (cobol program) after a commit.

Most triggering mechanisms supported by DB2 are based on the actual INSERT/UPDATE/DELETE of a row for a 'specific' table.
Notification of a successful COMMIT is the sole responsibility for the task causing the COMMIT.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Mar 04, 2011 10:20 pm    Post subject:
Reply with quote

actually, this is a repeat of http://ibmmainframes.com/viewtopic.php?t=53672
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Mar 04, 2011 10:37 pm    Post subject:
Reply with quote

Hello,

Quote:
so i am still now sure how to use right words to explain my need.
Possibly the biggest challange we have here at the forum is communication/language.

Maybe it will help if you explain why someone believes you need to do this (either "this" way or as mentioned in your other, similar topic).

My guess is that there are alternatives as i don't recall this ever being a requirement . . . We can offer suggestions only when we understand clearly what is intended.
Back to top
View user's profile Send private message
Haresh

New User


Joined: 04 Jan 2009
Posts: 18
Location: Germany

PostPosted: Sat Mar 05, 2011 12:53 am    Post subject:
Reply with quote

Hi,

sorry for not giving you guys the full picture. Below i have tried to give the full details and this is the reason why i have raised two similar topic.

Existing Funtionality:

- we have a DB2 table which is used by many applications, so the data are inserted/updated/deleted through various programs.

- we are replicating the data from this db2 table to an oracle database that resides in solaris system. This is done via db2 triggers -> stored procedure -> MQ -> Webservices -> Oracle database

- for each insert/update/delete the db2 triggers will call the SP and replicate

- the replication is done in near time

New Requirement:

- the data changes happen within a single unit of work for the same customer should be grouped together and should be replicated in single call.
For example within a unit of work there can be an couple of inserts, updates and deletes for single customer. The previous logic will do the replication for each data changes, but now all these changes should be captured and replicated in single call.

Solutions we have in mind:

- the first post from me is to check whether we can make the db2 triggers to work after commit. its clear that this is not possible

- next solution is the DB2 propagator which replicates to a local table after the commit, but its not cost effective for us.

- next one is that instead of calling stored procedure from triggers, insert all the resultant of triggers in an intermediate DB2 table.

By this all the changes are inserted only after the commit in the current unit of work (i already tested this).

The next problem is to replicate from the intermediate table to the oracle database in near time. For this one solution is to schedule a batch job for every 10 mins which reads the intermediate table and replicate.

I wanted to do some automatic process to start the replication, instead of scheduling the batch job for every 10 mins. Thats the reason i asked whether a db2 commit can trigger the execution of cobol program.

If you have any idea to do automatic process instead of batch scheduling, it would be very much helpful
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Commit limit for Delete query through... mf_karthik DB2 10 Thu Dec 17, 2015 12:56 am
No new posts Commit a DB2 Table on Unix Server and... Vinodh S DB2 3 Sun Apr 12, 2015 5:05 am
No new posts Need information on DB2 COMMIT sivasaras COBOL Programming 9 Wed Jun 11, 2014 7:34 pm
No new posts DB2 Commit thru Xpediter kinatingopi DB2 4 Wed Apr 30, 2014 4:46 am
No new posts Regarding commit in cics calling db2 ... ram_vizag CICS 7 Wed Feb 05, 2014 10:56 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us