I have a an online COBOL-CICS-DB2 program where I receive data through commarea from a front end Java application. This program is accessed from CICS Transaction Server using the program name -- no trans id -- by a Java application in WSAD.
The data would be inserted or updated in 10 different DB2 tables using CURSORs. For example if the insert/update using a cursor in the ninth DB2 table has failed.
How do I rollback all the previous tables which have been successfully inserted/updated? In other words, if the program has encountered any sort of error, I want to undo the whole transaction.
Unless I am missing something here in terms of your application design, as long as you do not COMMIT the ROLLBACK issued through the CICS program, it would roll back all of the updates to the beginning of the transaction -- or the last COMMIT/SYNCPOINT).
Editor's note: Do you agree with this expert's response? If you have more to share, post it in one of our
Dig Deeper on IBM DB2 management
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.