Posted: Tue Jun 03, 2003 10:35 am Post subject: DB2 Rollback in an CICS environment
I need some help in resolving/understanding the rollback functionality. I have a CICS transaction comming in, invokes the main program(A) which updates a row and calls program(B) which actually gets a -911, but the main program(A) does not check its return code and continues processing by updating few other tables and comes to an end.
Now what is the net result ?
since a -911 was issued and DB2 rolled back changes did it inform CICS to terminate the thread ?
I have a problem where part of the changes were rolled back and the second part comitted - can this be a fact ?(at this point its speculation that this is what happened)
The CICS RCT paramater ROLBE=YES
Once u get a -911 return code, it will rollback the changes only for that particular SQL query. The changes u have made in other DB2 queries will remain as it is. That is the reason some of ur changes are getting reflected and some are getting rollback.
Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
Posted: Wed Jun 25, 2003 2:55 pm Post subject:
SureshKumar,
How does Program A call Program B. If program A calls program B using a LINK then both the programs are under the same task and if there is any rollback in program B due to -911 or otherwise(If you issue an explicit ROLLBACK), then everything in that task will be rolled back including everything in program A unless you have committed anything in between using an explicit SYNCPOINT.
But, if program A XCTLs to program B, then program A and B are under different tasks and hence different units of work. Once, program A XCTLs to program B, everything is committed in program A, and then if there is a -911 in program B, only program B updates will be rolled back.
BTW - It is really very very very bad programming practice of not to check for SQLCODES after every SQL statement. I am surprised on how your program B did not abend with an ASP3 for the -911 SQLCODE that you got and you could continue processing.
vspangtey, Under CICS environment, there is no rollback for particular SQL queries. ROLLBACK is for the entire unit of work.
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