Posted: Wed Nov 16, 2005 3:55 pm Post subject: CICS - DB2 - TASK clarification
Hello All,
I need some calrifiactions on using SYNCPOINT. I have PGM A linking PGM B. PGM B links to PGM C. I have some data base insertes in PGM B and in PGM C. In such a case, if I got sql error in PGM C, i want to return to PGM B and then return to Program A and then issue a SYNCPOINT ROLLBACK. In this case whtever the database changes that were done in PGM B and PGM C will be rolled back. I do not want to use rollback/syncpoint in every linking program. I would like to do either a syncpoint or rollback only in PGM A.I think the chages will be rolled back, as the PGM A, PGM B, PGM C runs under the same task.PGM A will be triggered by the MQ. So I want to issue a sysncpoint only after I have done all the changes including the MQ changes. The queues are not persistent queus. I did a search through the forums. I got couple of postings which are very close to my scenario. But in one posting it states that as soon as you return to the calling program (to the linking program)by issuing CICS RETURN the changes will get committed and the task will be ended. Will the PGM A, PGM B, PGM C runs under the same task or for each linked program a seperate task will be created.
Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
Posted: Thu Nov 17, 2005 9:50 am Post subject:
haqshaik,
Quote:
Will the PGM A, PGM B, PGM C runs under the same task or for each linked program a seperate task will be created.
The programs will run under the same task.
The easiest solution in your case would be to issue a SYNCPOINT ROLLBACK whenever and in whichever program you encounter the SQL error. That would rollback all the changes in your task. If you want rollbacks to certain points in your task, you can use SAVEPOINTS.
HTH....Regards,
Manas _________________ There is no path to peace. Peace is the path.
- Mahatma Gandhi (1869-1948)
Manas,
Thanks for your help and time. The only thing why I want to keep the roll back in the main program is to avoid repeititive coding in all the linked programs. That way the error handling will be centralised. As all the programs are running under the same task we can keep the rollback in any program. The other concern I have is the Bind parameter, and its defined as release deallocate. I am not sure when we say release deallocate, will it release the package pertained to the program and release the resources.lf it is releasing the packege, then the changes will be commited, if we keep the roll back in PGM A. All the three programs are bound to the same plan. on the other hand if it releases the plan , then keeping the rollback in PGM A will work out. But on the other hand, the disadvantage is, it will hold the reources unitl the plan is released or a roll back or synpoint commit is issued. Could you please correct me if my understanding was correct?. But if we concern the above said points, in either case, having the roll back whenever SQL error occurs seems to be the best option.
Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
Posted: Fri Nov 18, 2005 10:07 am Post subject:
haqshaik,
I am a bit unclear of your question and your exact requirement. I don't understand the relationship between your very first question and the RELEASE BIND option. The RELEASE option specifies when resources will be released by your application plan. If RELEASE (COMMIT) is used, then the resources locked by your application plan will be released at the time of SQL commit and if RELEASE(DEALLOCATE) is used, then the resources will be released when your application plan is deallocated.
Which RELEASE option to use depends on what your requirements are vis-a-vis concurency and availbility. The following link is a very concise and easy to understand article on the same -
[url]
http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0406whitlark/
[/url]
As far as your original question about SYNCPOINT is concerned, I would recommend coding a seprate error routine which will take in the SQLCA, call DSNTIAR, generate the error message, do any rollback processing(as needed) and abend gracefully. You can call this routine from your main programs, whenever you do a SQL code checking.
HTH...Regards,
Manas _________________ There is no path to peace. Peace is the path.
- Mahatma Gandhi (1869-1948)
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