MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DB2 Appln. without Commit

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
vini
Intermediate


Joined: 12 Jan 2004
Posts: 240
Topics: 48
Location: Maryland

PostPosted: Thu Jan 29, 2004 12:03 am    Post subject: DB2 Appln. without Commit Reply with quote

Given a Cobol DB2 Application which has NO Commits or Rollbacks.
How will it behave under following cases :

1) Successful completion
- Will it automatically commit ? If yes, then how is it different from an App. which has a Forced commit at the end ?

2) Abend in the nth Update encountered during Appln. run .
- Will only this nth SQL be Rolledback automatically or the whole Unit of work ?

Vini
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Thu Jan 29, 2004 4:56 am    Post subject: Reply with quote

vini,

1.A successful completion of the program will auotmatically commit all the updates/deletes. There is absolutely no difference between forced commit at the end and successful completion commit

2. Yes

However I would consider that as a very bad design considering that it is a pure COBOL-DB2 program. But if you have CICS or IMS , then you don't have to code an explicit commit. A syncpoint or Checkpoint will commit all the updates/deletes. Also remember that you will be holding the resources for the entire run which might affect other applications.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vini
Intermediate


Joined: 12 Jan 2004
Posts: 240
Topics: 48
Location: Maryland

PostPosted: Thu Jan 29, 2004 9:42 am    Post subject: Reply with quote

Kolusu,

In reality I have never come across such an App. in production atleast but I was curious to know and confess that many times I leave the commit rollback logic pending until after I have unit tested the pgm.

Most programs Commit after every threshold count for commit is reached..and thats perfect for good reasons..like you mentioned about resources.

However, does it mean that the last forced commit in a program (non-CICS) is kind of redundant on successful completion ..as db2 would anyway commit .In other words ..no matter how many commits a program does..there will always be one more from db2 on successful completion ?!

Thanks
Vini.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Thu Jan 29, 2004 12:26 pm    Post subject: Reply with quote

Vini,

Usually a typical COBOL-DB2 program will run using the TSO Terminal Monitor Program (TMP) which is IKJEFT01.

A commit is issued when the program terminates(successful completion ofcourse) and returns to the DSN command processor, which returns to the back to the TMP. In this scenario if you have a forced commit at the end of the program then it becomes reduntant.

Yes there will always be one more commit from DB2 but it is not visible to the user.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vini
Intermediate


Joined: 12 Jan 2004
Posts: 240
Topics: 48
Location: Maryland

PostPosted: Thu Jan 29, 2004 2:58 pm    Post subject: Reply with quote

Kolusu,
If we have a simple Cobol pgm (no SQLs or db2) do we still call IKJEFT01 (in JCL) or something else ?

Thanks
Vini
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Thu Jan 29, 2004 6:12 pm    Post subject: Reply with quote

Vini,

If it plain cobol pgm you just run it using PGM=cbl-pgm-name.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group