View previous topic :: View next topic |
Author |
Message |
vini Intermediate
Joined: 12 Jan 2004 Posts: 240 Topics: 48 Location: Maryland
|
Posted: Thu Jan 29, 2004 12:03 am Post subject: DB2 Appln. without Commit |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
|
Posted: Thu Jan 29, 2004 4:56 am Post subject: |
|
|
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 |
|
 |
vini Intermediate
Joined: 12 Jan 2004 Posts: 240 Topics: 48 Location: Maryland
|
Posted: Thu Jan 29, 2004 9:42 am Post subject: |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
|
Posted: Thu Jan 29, 2004 12:26 pm Post subject: |
|
|
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 |
|
 |
vini Intermediate
Joined: 12 Jan 2004 Posts: 240 Topics: 48 Location: Maryland
|
Posted: Thu Jan 29, 2004 2:58 pm Post subject: |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
|
Posted: Thu Jan 29, 2004 6:12 pm Post subject: |
|
|
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 |
|
 |
|
|