View previous topic :: View next topic
|
Author |
Message |
loverj24
New User
Joined: 05 Jul 2007 Posts: 16 Location: bangalore
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
loverj24
New User
Joined: 05 Jul 2007 Posts: 16 Location: bangalore
|
|
|
|
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 |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
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 |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Sorry, it's
Code: |
EXEC CICS SYNCPOINT ROLLBACK END-EXEC |
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
|