Page 1 of 1

COMMIT in COBOL-DB2 program and Xpeditor.

Posted: Wed Jan 06, 2016 12:16 pm
by Jyoti Sharma
In a COBOL-DB2 program, if we don't put a COMMIT statement and test it using Xpeditor, when will the COMMIT happen? As there is no explicit COMMIT in the program? Will Xpeditor force it?

Actually, when I tested a Cobol-DB2 program without a COMMIT in xpediter, the data base updates did not reflect in the table. Is it a normal behavior?

Re: COMMIT in COBOL-DB2 program and Xpeditor.

Posted: Wed Jan 06, 2016 6:02 pm
by nicc
What does the manual say?
Why are you not explicitly doing a COMMIT or ROLLBACK thus leaving yourself, and others, unsure as to what will happen?

Re: COMMIT in COBOL-DB2 program and Xpeditor.

Posted: Thu Jan 07, 2016 7:02 am
by mmcrew
In a batch DB2 program, if you don't explicitly execute a COMMIT or ROLLBACK, a COMMIT is performed when the highest level program issues a GOBACK.
In a CICS/DB2 program, if you don't explicitly execute a COMMIT or ROLLBACK, a COMMIT is performed when the highest level program issues a EXEC CICS RETURN.

Re: COMMIT in COBOL-DB2 program and Xpeditor.

Posted: Thu Jan 07, 2016 9:33 am
by Robert Sample
Actually, when I tested a Cobol-DB2 program without a COMMIT in xpediter, the data base updates did not reflect in the table. Is it a normal behavior?
Depending on when you're looking for the data to be in the data base, this could be normal behavior or not. If you're looking for the data while the Xpediter session is still underway, then it is normal behavior -- the program is still running as far as the system is concerned. If you're looking for the data after Xpediter has completely ended, then it is possibly not normal -- but the final determination of that depends upon other factors (such as how you're executing the program).

Re: COMMIT in COBOL-DB2 program and Xpeditor.

Posted: Mon Jan 11, 2016 2:10 pm
by Jyoti Sharma
nicc wrote:What does the manual say?
Why are you not explicitly doing a COMMIT or ROLLBACK thus leaving yourself, and others, unsure as to what will happen?


I am trying to learn. When program executes without the xpediter the changes in the table are reflected but with it, it is not reflecting. Which is why it causes confusion.

Re: COMMIT in COBOL-DB2 program and Xpeditor.

Posted: Mon Jan 11, 2016 2:36 pm
by Jyoti Sharma
mmcrew wrote:In a batch DB2 program, if you don't explicitly execute a COMMIT or ROLLBACK, a COMMIT is performed when the highest level program issues a GOBACK.
In a CICS/DB2 program, if you don't explicitly execute a COMMIT or ROLLBACK, a COMMIT is performed when the highest level program issues a EXEC CICS RETURN.
mmcrew thank for your reply.

For my case it's a single program so after successful execution the program should commit, which it does. But with xpediter it does not. So not sure what might casue it.

Re: COMMIT in COBOL-DB2 program and Xpeditor.

Posted: Mon Jan 11, 2016 5:07 pm
by nicc
Because Xpediter is the highest level' program in this case, so until the Xpediter session ends the commit is not made.