COMMIT in COBOL-DB2 program and Xpeditor.

RDBMS from IBM and IBM's Hierarchical DBMS and Transaction Manager (IMS DC).
Post Reply
Jyoti Sharma
New Member
Posts: 5
Joined: Tue Aug 12, 2014 12:49 pm

COMMIT in COBOL-DB2 program and Xpeditor.

Post 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?
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: COMMIT in COBOL-DB2 program and Xpeditor.

Post 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?
Regards
Nic
mmcrew
New Member
Posts: 4
Joined: Thu Dec 24, 2015 7:53 am

Re: COMMIT in COBOL-DB2 program and Xpeditor.

Post 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.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: COMMIT in COBOL-DB2 program and Xpeditor.

Post 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).
Jyoti Sharma
New Member
Posts: 5
Joined: Tue Aug 12, 2014 12:49 pm

Re: COMMIT in COBOL-DB2 program and Xpeditor.

Post 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.
Jyoti Sharma
New Member
Posts: 5
Joined: Tue Aug 12, 2014 12:49 pm

Re: COMMIT in COBOL-DB2 program and Xpeditor.

Post 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.
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: COMMIT in COBOL-DB2 program and Xpeditor.

Post by nicc »

Because Xpediter is the highest level' program in this case, so until the Xpediter session ends the commit is not made.
Regards
Nic
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM DB2 and IMS DB/DC”