IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to include Rollback in CICS program


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Dec 26, 2007 8:01 pm
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
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: 1353
Location: Israel

PostPosted: Wed Dec 26, 2007 8:15 pm
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: 1353
Location: Israel

PostPosted: Wed Dec 26, 2007 8:24 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Dec 26, 2007 8:32 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Calling an Open C library function in... CICS 1
No new posts How to 'Ping' a CICS region in JCL CICS 2
No new posts Parallelization in CICS to reduce res... CICS 4
Search our Forums:

Back to Top