View previous topic :: View next topic
|
Author |
Message |
ashishsr123
New User
Joined: 06 May 2008 Posts: 33 Location: Chennai
|
|
|
|
Hello,
I want to devise a cobol-db2 program and commit after every 1000 rows . What are the
1)possible
2) Most efficient
way out. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
i just maintain a counter (incremented after every SELECT/FETCH/UPDATE - whatever) and check it for 1000 and when it is 1000, COMMIT and reset the counter.
I would suggest reading the links provided in this thread |
|
Back to top |
|
|
ashishsr123
New User
Joined: 06 May 2008 Posts: 33 Location: Chennai
|
|
|
|
We can use checkpoint restart table also for committing...can someone throw some more light on this, I am not fully aware of this. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If your organization has implemented some kind of restart table it is completely site-specific. You need to speak with your dba or project senior as to how this is implemented and used on your application (if it is at all).
In about 99% of the applications these days (due to the incredible sppe increase in cpus and dasd) there is no reason to build in restart procedures. It is cleaner to simply restart from the beginning.
Depending on what functions the process provides, properly implementing restart may be far from trivial. Most large batch update jobs (which are the ones that might even be candidates for restart) do more than simply update tables. Audit trail reports are often created, sequential files may be created and so on. Everything must be re-synchronized if a restart is to be implemented.
Keep in mind that jobs should run to successful completion and if one does regularly not run successfully, that job needs to be fixed. If the code is so poor that it will not run correctly, an attempt at implementing restart will probably cause more problems than it provides benefit. |
|
Back to top |
|
|
|