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 include Rollback in CICS program

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

New User


Joined: 05 Jul 2007
Posts: 16
Location: bangalore

PostPosted: Wed Dec 26, 2007 7:48 pm    Post subject: How to include Rollback in CICS program
Reply with quote

Hi Friends,
I have a CICS program which calls inserts data into 3 tables, this data is being used by an online application. When a user resgiters through a online application, data gets inserted into three tables. If somehow the online application fails when the user is registering, data is still being present in the three tables. This is casing an inconsistency in the database.
Please advice me how to use the rollback condition in the CICS program and then how to complile it. Thanks!!
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Wed Dec 26, 2007 8:01 pm    Post subject: Reply to: How to include Rollback in CICS program
Reply with quote

Quote:
If somehow the online application fails when the user is registering, data is still being present in the three tables


I would say that somewhere in Your application some commit' s are done...
explicit or implicit due to the flow of application programs
usually depending on the way different programs are xctl' ed, link' ed, start' ed...

as usual an agreement on the terminology is needed...
what is an application failure ?
a logical one or a physical one ?

Rollback in case of a physical failure IS usually the standard behavior,
without the need of issuing explicit rollbacks...
in case of a logical/programmed one...
all the database activities must be reviewed and acted accordingly
Back to top
View user's profile Send private message
loverj24

New User


Joined: 05 Jul 2007
Posts: 16
Location: bangalore

PostPosted: Wed Dec 26, 2007 8:09 pm    Post subject:
Reply with quote

Dear Enrico,
Faliure in the application program means for ex: I open two IE windows and start registring in to any website. My CICS program is allowing the user to register both the times. i just want ot include a rollback condtion so that if it finds data inserted into the database, it does not go ahead and reinsert it.
I want yo rollback that current trasaction.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1232
Location: Israel

PostPosted: Wed Dec 26, 2007 8:15 pm    Post subject:
Reply with quote

Quote:
If somehow the online application fails when the user is registering, data is still being present in the three tables

An online application can fail in many ways.
If you have an ABEND, it should rollback automatically.
If you terminate the transaction and there is no abend, you should do the rollback before leaving:
Code:
    EXEC CICS ROLLBACK SYNCPOINT END-EXEC
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1232
Location: Israel

PostPosted: Wed Dec 26, 2007 8:24 pm    Post subject:
Reply with quote

Sorry, it's
Code:
EXEC CICS SYNCPOINT ROLLBACK END-EXEC
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Wed Dec 26, 2007 8:32 pm    Post subject: Reply to: How to include Rollback in CICS program
Reply with quote

Quote:
Faliure in the application program means for ex: I open two IE windows and start registring in to any website. My CICS program is allowing the user to register both the times. i just want ot include a rollback condtion so that if it finds data inserted into the database, it does not go ahead and reinsert it.


You might not like the comment... but
That' s not a failure...
that' s poor application design full stop

it' s strange/unconceivable to realize that a duplicate conditions exists after
having updated three databases

Any properly designed application will check everything before starting the updates !!
without the need to issue rollbacks
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 Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts How to Clear all TSQs during CICS sta... Hooman24 CICS 10 Mon Jun 26, 2017 9:46 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 pm
No new posts Include/omit with "ALL" pa... mgl DFSORT/ICETOOL 6 Wed Jun 14, 2017 2:31 pm


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