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 

DB2 Rollback in an CICS environment

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


Joined: 23 Jan 2003
Posts: 211
Topics: 21

PostPosted: Tue Jun 03, 2003 10:35 am    Post subject: DB2 Rollback in an CICS environment Reply with quote

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
Back to top
View user's profile Send private message
vspangtey
Beginner


Joined: 13 Jun 2003
Posts: 7
Topics: 3

PostPosted: Tue Jun 17, 2003 5:12 am    Post subject: Reply with quote

Hi suresh,

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.

Regards,
Vineet.
Back to top
View user's profile Send private message
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Wed Jun 25, 2003 2:55 pm    Post subject: Reply with quote

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.

Regards,
Manas
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
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