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
 

 

How to roll back my work in online program.

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

New User


Joined: 05 Jun 2006
Posts: 51
Location: Bangalore,India

PostPosted: Thu Aug 23, 2007 6:09 pm    Post subject: How to roll back my work in online program.
Reply with quote

Hi,

I have an online program which is inserting records into 3 db2 tables. This program should behave as follows:--

If the record insertion is successful in all the tables no need to do anything

If the record is inserted in first table and if it fails to insert in to 2nd or 3rd table we need to roll back the record which is already inserted in the prebvious table. We are checking for DB2 return code after every insert and if it is not zero we are calling error para.

Note:-- There no expilict commit or roll back in my program.
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Aug 23, 2007 6:16 pm    Post subject:
Reply with quote

If I recall correctly, the EC SYNCPOINTs replace the DB2 COMMITs.
Using the syncpoint, keep the three table updates within a single LUW (logical unit of work).
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Aug 23, 2007 6:20 pm    Post subject:
Reply with quote

You can't use a DB2 ROLLBACK in a CICS program, you have to use a CICS rollback.
Code:
EXEC CICS                 
  SYNCPOINT ROLLBACK     
END-EXEC.                 
Back to top
View user's profile Send private message
vardhan0007

New User


Joined: 05 Jun 2006
Posts: 51
Location: Bangalore,India

PostPosted: Thu Aug 23, 2007 7:39 pm    Post subject:
Reply with quote

Here is my error para.If Iam understanding correctly ,I can put the above rollback in this para?

Z100-SQL-ERROR.

SET REQ-DB2-ERROR TO TRUE.

EXEC CICS

SYNCPOINT ROLLBACK

END-EXEC.


MOVE SQLCODE TO REQ-WEB-SQLCODE.

MOVE WS-HOLD-TRANSID TO EIBTRNID.

GO TO 000-RETURN.
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: Thu Aug 23, 2007 7:51 pm    Post subject:
Reply with quote

Hello,

That should rollback the current LUW (logical unit of work).

You need to make sure that only what you want is rolled back. If there were uncommitted updates to other than your 3 tables, those updates will also be rolled back.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Aug 23, 2007 8:06 pm    Post subject:
Reply with quote

vardhan0007 wrote:
Here is my error para.If Iam understanding correctly ,I can put the above rollback in this para?
Yes, but as Dick indicated, you will need a syncpoint without the rollback after each pass of successful updates to keep prior ones from rolling back too.....
Back to top
View user's profile Send private message
vardhan0007

New User


Joined: 05 Jun 2006
Posts: 51
Location: Bangalore,India

PostPosted: Thu Aug 23, 2007 8:38 pm    Post subject: Reply to: How to roll back my work in online program.
Reply with quote

Ok. If the insertion fails into any of the tables i need to roll back the record for only on that transaction. Means that unit of work or request. So I can go ahead with above change ?. One more query :- How to know the syncpoints?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Aug 23, 2007 9:06 pm    Post subject: Re: Reply to: How to roll back my work in online program.
Reply with quote

vardhan0007 wrote:
Ok. If the insertion fails into any of the tables i need to roll back the record for only on that transaction. Means that unit of work or request. So I can go ahead with above change ?. One more query :- How to know the syncpoints?
Is each update of the three tables a separate transaction? If so then the end of the prior transaction (return to CICS) marked the end of the LUW and explicit syncpoints aren't needed, just the rollback.....
Back to top
View user's profile Send private message
vardhan0007

New User


Joined: 05 Jun 2006
Posts: 51
Location: Bangalore,India

PostPosted: Thu Aug 23, 2007 9:16 pm    Post subject:
Reply with quote

I will get the all details from java mercator call and i will insert all the details into 3 different tables. If any one of the insert fails i need to roll back the insert whcih i had done for one table. So i think it is one transaction. Please let me know how to keep syncpoints.

Thanks,
Harsha
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Aug 23, 2007 9:40 pm    Post subject:
Reply with quote

Syncpoints are done just like the rollback, but without the rollback in them..... icon_smile.gif
Back to top
View user's profile Send private message
vardhan0007

New User


Joined: 05 Jun 2006
Posts: 51
Location: Bangalore,India

PostPosted: Thu Aug 23, 2007 9:51 pm    Post subject:
Reply with quote

How to know whether it is a one transaction or not please advice as Iam new to CICS icon_confused.gif
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: Thu Aug 23, 2007 9:57 pm    Post subject:
Reply with quote

Hello,

The checkpoint/rollback/restart functionality is usually common for an environment.

I'd suggest you talk with others who have update/backout processes already running in that environment.

If is not a good practice to have a different scheme for each author and/or transaction.

If you have not done so already, some time would be well spent with your database support people.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Aug 23, 2007 9:59 pm    Post subject:
Reply with quote

I can't tell, but if you are in doubt, use the syncpoint after the third table update and before you return....

Does the transaction number change with each entry into your program? If it does, thats a "new" transaction.....
Back to top
View user's profile Send private message
vardhan0007

New User


Joined: 05 Jun 2006
Posts: 51
Location: Bangalore,India

PostPosted: Wed Sep 26, 2007 1:06 pm    Post subject:
Reply with quote

Hi,

I had implimented SYNCPOINT/ROLLBACK logic in my program. It compiled successfully .But I got a mail from CICS people that my program is crashing the region. Can anyone let me know what may be the reason.

Thanks in advance.

Harsha.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed Sep 26, 2007 2:22 pm    Post subject:
Reply with quote

That's great, progress.....
Crashing the region....That's a nice technical term....
I can only guess that your logic is faulty.....
Back to top
View user's profile Send private message
vardhan0007

New User


Joined: 05 Jun 2006
Posts: 51
Location: Bangalore,India

PostPosted: Wed Sep 26, 2007 2:56 pm    Post subject:
Reply with quote

icon_sad.gif Please advice me where I am going wrong. Just I had made a syncpoint brfore insertion of into first table and i have the rollback in db2 error para.

Thanks,
Harsha.
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: Wed Sep 26, 2007 8:28 pm    Post subject:
Reply with quote

Hello,

From what you posted, the only advice someone here can offer is "fix your code".

I'm sure that is not an answer you can work with.

If you post that part of the code that "crashes" and the diagnostic information presented by the system, we may be able to help.
Back to top
View user's profile Send private message
vardhan0007

New User


Joined: 05 Jun 2006
Posts: 51
Location: Bangalore,India

PostPosted: Wed Sep 26, 2007 8:54 pm    Post subject:
Reply with quote

Hi Dic,

My code change is as follows.

I had kept EXEC CICS
SYNCPOINT
END-EXEC.

before the isertion into the tables.There is an error para wher we are calling if anything goes wrong in sql operation. In that error para i had kept

EXEC CICS
SYNCPOINT ROLLBACK
END-EXEC.

Below is the dump

CEE3501S The module CEEWUCHA was not found.
CEE3250C The system or user abend ADPL was issued.
From compile unit XXXXXXX at entry point P6330V12 at compile unit offset +000024B0 at entry offset +000024B0 at address
1B547EC0.

XXXXXX = Program Name.
Please advice.

Thanks,
Harsha
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: Wed Sep 26, 2007 9:54 pm    Post subject:
Reply with quote

Hello,

Did you look up the ADPL abend? If not, you should.

What is the code in youjr program here
Quote:
From compile unit XXXXXXX at entry point P6330V12 at compile unit offset +000024B0 at entry offset +000024B0


I'd suggest you talk with your CICS system support and determine why CEEWUCHA cannot be found.
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 -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts A sample of exit program for exit XMN... lind sh CICS 2 Mon Oct 03, 2016 5:07 pm
No new posts Need points to tune IMS Checkpoint Pr... satish.ms10 IMS DB/DC 2 Fri Sep 30, 2016 4:12 pm
No new posts ISPF program to set SCRNAME prino TSO/ISPF 5 Fri Sep 30, 2016 2:18 pm


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