|
View previous topic :: View next topic
|
| Author |
Message |
Sysaron
New User

Joined: 28 Sep 2005 Posts: 55 Location: USA
|
|
|
|
Hi DB2 people,
Does the GOBACK statement in a called COBOL DB2 program create an implicit COMMIT to the database?
Or does the GOBACK statement when used in Sub-program return control back to Main program and an IMPLICIT COMMIT will not be performed, and the Explicit commit will need to be coded.
Thanks so much in Advance to you all,
Sharon |
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
have had a little too much of myself lately,
so i offer this:
This is written from a Batch prospective,
as far as what go on in a COBOL Thread (task):
there is no such thing as an IMPLICIT or EXPLICIT COMMIT.
either you code for it and
-------the unit-of-work for that task is COMMITted, and you continue executing, db2 storing current-unit-of-work-status (type stuff) until the next COMMIT or ROLLBACK or STOP RUN (or GOBACK from the main module)
or you don't and
-------a COMMIT or ROLLBACK will be invoked by whatever is running the COBOL EXEC,
when the RUN UNIT/THREAD/TASK ends.
which is when all GOBACKs or a STOP RUN have been executed.
as far as the db2 flow (unit-of-work) is concerned,
the effect of the COBOL code is the same as the final EXIT (implicit or explicit )
of a PERFORM.
A GOBACK of a COBOL program is only a bunch of IFs and BRs (GO TOs)
if the returned-to program is part of the operating-system that invoked the mainmodule,
then we enter into the clean-up phase of the 'executor'
(i think that is what it is called )
part of ops-sys and when the detach to db2 (task disconnect) is made,
db2 checks for outstanding commits,
depending upon db2 bind parms, db2 either issues a COMMIT or ROLLBACK,
which will release all memory, dasd and whatever else db2 has claimed for the last unit-or-work for the task. |
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
Sorry, did not answer your question.
i tried to give you another perspective,
inclusive of jargon,
with which you may want to use when you rewrite your assumptions,
and answer your own question. |
|
| Back to top |
|
 |
|
|