How to do SELECTIVE COMMIT in a COBOL DB2 program?
How to do SELECTIVE COMMIT in a COBOL DB2 program?
Hi,
I have a COBOL DB2 program that updates many DB2 tables in it. However, I was thinking to COMMIT only some of the tables and not all. If I issue a COMMIT it'll update all the tables but I want to commit only a some DB2 tables. Is it possible to do such selective commit in a COBOL DB2 program?
Please guide with some thoughts or documents.
I have a COBOL DB2 program that updates many DB2 tables in it. However, I was thinking to COMMIT only some of the tables and not all. If I issue a COMMIT it'll update all the tables but I want to commit only a some DB2 tables. Is it possible to do such selective commit in a COBOL DB2 program?
Please guide with some thoughts or documents.
-
- Global Moderator
- Posts: 826
- Joined: Wed Sep 11, 2013 3:57 pm
Re: How to do SELECTIVE COMMIT in a COBOL DB2 program?
NO.Is it possible to do such selective commit in a COBOL DB2 program?
and anyway,
why would You want to do something contrary to proper data integrity Logic?
Just forget about it.
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
-
- Global Moderator
- Posts: 490
- Joined: Sun Aug 25, 2013 7:24 pm
Re: How to do SELECTIVE COMMIT in a COBOL DB2 program?
Why would you want to do that? enrico has alluded to the dangers. What are you hoping would happen if you were only able to commit little bits and pieces?
Re: How to do SELECTIVE COMMIT in a COBOL DB2 program?
For a financial calculation I need some input from the input file. Based the today's input the base rate in the table will be updated and now that rate should be taken for the final calculation. That is why I thought to have an intermediate commit for some tables which has got the base rate.
Re: How to do SELECTIVE COMMIT in a COBOL DB2 program?
That is bad design. You need two programs. one to update the tables and one to use the updated tables. Alternatively you design restart logic so that if the table has alredy been updated then you do not update it again - unless such an update is simply replacing the current values.
Regards
Nic
Nic
- Anuj Dhawan
- Founder
- Posts: 2802
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: How to do SELECTIVE COMMIT in a COBOL DB2 program?
Yes, you should rethink about the design approach. On the other hand, if these program were designed long back and you find yourself in the middle of the mud - one possible way out is, update the tables you think you should COMMIT; store the other information in some temporary area of your program, and issue a COMMIT.
Don't forget to implement a check-point restart logic, as nicc has also said.
Don't forget to implement a check-point restart logic, as nicc has also said.
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
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