Upload
vibhaw-prakash-rajan
View
216
Download
0
Embed Size (px)
Citation preview
8/12/2019 CDB Commit
1/3
2/27/2014 CDB Software, Inc.
http://www.cdbsoftware.com/whitepapers/cmnews-quarter4-2012.php 1/3
CDB Global//CDB North America// CDB International
HomeNews &Events
Webcasts
Press Releases
White Papers & Articles
About CDB
CDB North America
CDB International
CDB Global
Products & Solutions
Packages
Real Time DB2 Data Management Solution
Real Time DB2 Database Maintenance Solution
DB2 Index Management Solution
DB2 Image Copy Solution
DB2 Partition Management SolutionDB2 Data Propagation Solution
Product List
Support
Policies & Guidelines
Product Compatibility
Onsite Training
News &Notifications
Product Documentation
Technical Bulletins
PTFs & Libraries
Online Training Videos
My Profile
Partners
Become a Partner
Meet Our Partners
Contact Us
Login
White Papers & Articles
4th Quarter 2012
http://www.cdbsoftware.com/supporthttp://www.cdbsoftware.com/supporthttp://www.cdbsoftware.com/become-a-partner.phphttp://www.cdbsoftware.com/become-a-partner.phphttp://www.cdbsoftware.com/supporthttp://www.cdbsoftware.com/supporthttp://www.cdbsoftware.com/supporthttp://www.cdbsoftware.com/supporthttp://www.cdbsoftware.com/onsite-training.phphttp://www.cdbsoftware.com/product-compatibility.phphttp://www.cdbsoftware.com/policies-and-guidelines.phphttp://www.cdbsoftware.com/db2-data-propagation-solution.phphttp://www.cdbsoftware.com/db2-index-management-solution.phphttp://www.cdbsoftware.com/real-time-db2-data-management-solution.phphttp://www.cdbsoftware.com/real-time-db2-data-management-solution.phphttp://www.cdbsoftware.com/about-cdbglobal.phphttp://www.cdbsoftware.com/about-cdb.phphttp://www.cdbsoftware.com/white-papers-and-articles.phphttp://www.cdbsoftware.com/press-releases.phphttp://www.cdbsoftware.com/webcasts.phphttp://www.cdbsoftware.com/webcasts.phphttp://www.cdbsoftware.com/about-cdbglobal.phphttp://www.cdbsoftware.com/about-cdb.phphttp://www.cdbsoftware.com/index.phphttp://www.cdbsoftware.com/index.phphttp://www.cdbsoftware.com/index.phphttp://www.cdbsoftware.com/index.phphttp://www.cdbsoftware.com/supporthttp://www.cdbsoftware.com/contact-us.phphttp://www.cdbsoftware.com/meet-our-partners.phphttp://www.cdbsoftware.com/become-a-partner.phphttp://www.cdbsoftware.com/become-a-partner.phphttp://www.cdbsoftware.com/supporthttp://www.cdbsoftware.com/supporthttp://www.cdbsoftware.com/supporthttp://www.cdbsoftware.com/supporthttp://www.cdbsoftware.com/supporthttp://www.cdbsoftware.com/supporthttp://www.cdbsoftware.com/onsite-training.phphttp://www.cdbsoftware.com/product-compatibility.phphttp://www.cdbsoftware.com/policies-and-guidelines.phphttp://www.cdbsoftware.com/policies-and-guidelines.phphttp://www.cdbsoftware.com/product-list.phphttp://www.cdbsoftware.com/db2-data-propagation-solution.phphttp://www.cdbsoftware.com/db2-partition-management-solution.phphttp://www.cdbsoftware.com/db2-image-copy-solution.phphttp://www.cdbsoftware.com/db2-index-management-solution.phphttp://www.cdbsoftware.com/real-time-db2-database-maintenance-solution.phphttp://www.cdbsoftware.com/real-time-db2-data-management-solution.phphttp://www.cdbsoftware.com/real-time-db2-data-management-solution.phphttp://www.cdbsoftware.com/about-cdbglobal.phphttp://www.cdbsoftware.co.uk/http://www.cdbsoftware.com/about-cdb.phphttp://www.cdbsoftware.com/about-cdb.phphttp://www.cdbsoftware.com/white-papers-and-articles.phphttp://www.cdbsoftware.com/press-releases.phphttp://www.cdbsoftware.com/webcasts.phphttp://www.cdbsoftware.com/webcasts.phphttp://www.cdbsoftware.com/index.phphttp://www.cdbsoftware.co.uk/http://www.cdbsoftware.com/about-cdb.phphttp://www.cdbsoftware.com/about-cdbglobal.phphttp://www.cdbsoftware.com/index.php8/12/2019 CDB Commit
2/3
2/27/2014 CDB Software, Inc.
http://www.cdbsoftware.com/whitepapers/cmnews-quarter4-2012.php 2/3
The Perils of Bachelor Programming Syndrome
Every DB2 application program should issue COMMIT statements whenever the program modifies data. A
COMMIT externalizes all modifications made by the program since it began or since the last COMMIT. I
refer to the practice of not coding COMMITs in DB2 programs as Bachelor Programming Syndrome in
other words,fear of committing. A COMMIT ensures that all modifications have been physically applied
to the DB2 log, thereby ensuring data integrity and recoverability.
One factor impacting the need for a COMMIT strategy is the amount of elapsed time required for the
program to complete. The greater the amount of time needed, the more important it becomes to issue
COMMITs to reduce rollback time and reprocessing time in the event of program failure.
Issuing COMMITs in an application program is important for three reasons. First, if the program fails, all the
modifications are backed out to the last COMMIT point. This process could take twice the time it took to
perform the modifications in the first place especially if you are near the end of a program with no
COMMITs that performed hundreds or thousands of modification operations.
Second, if you resubmit a failing program that issues no COMMITs, the program must redo work
unnecessarily.
Third, programs bound using the repeatable read page locking strategy or the RELEASE(COMMIT) table
space locking strategy hold their respective page and table space locks until a COMMIT is issued. If no
COMMITs are issued during the program, locks are not released until the auto-COMMIT when the program
completes, thereby negatively affecting concurrent access. This can cause lock timeouts and lock escalation.
If your program is running for a long time and has issued no COMMITs, your program is probably not going
to be the one to suffer. However, every other process attempting to access the data that is locked by yourprogram will suffer. If you regularly see a large number of -911 and -913 SQL return codes in your DB2
subsystem, it is a safe bet that you have at least one long-running program (maybe more) that needs to have
COMMIT logic added.
It is also good programming practice to issue periodic COMMITs in long-running read-only programs. Even
though data is not being changed, DB2 acquires read locks whenever data is accessed. A read lock can
block DB2 utility programs from operating successfully. Therefore, failure to COMMIT, even in a read-only
program, can result in online utilities not being able to issue a drain, and thereby not completing.
For these reasons, I recommend that you plan to issue COMMITs in every batch DB2 program.
Contribution by Craig Mullins
Craig S. Mullins, president and principal consultant of Mullins Consulting, Inc., is a data management
strategist, researcher, and consultant. He has nearly three decades of experience in all facets of database
systems development and has worked with mainframe DB2 since V1. You may know Craig from his popular
books: DB2 Developers Guide (with over 1500 pages of in-depth technical information on DB2 for z/OS)
and Database Administration: The Complete Guide to Practices and Procedures (the industrys only
comprehensive guide to heterogeneous database administration). Craig can be reached via his website atwww.craigsmullins.com.
return to white papers
http://www.cdbsoftware.com/white-papers-and-articles.phphttp://www.craigsmullins.com/8/12/2019 CDB Commit
3/3
2/27/2014 CDB Software, Inc.
http://www.cdbsoftware.com/whitepapers/cmnews-quarter4-2012.php 3/3
Press Releases
White Papers & Articles
Press Contacts
About CDB
HomeNews & EventsAbout CDBProducts & SolutionsSupportPartnersContact UsLogin
Copyright 2012-2014 CDB Software All Rights Reserved. | Legal Disclaimer
CDB Software, Inc.
Toll-Free: 800-627-6561
Phone: 713-588-1778
Fax: 800-627-4232
mailto:[email protected]://www.cdbsoftware.com/legal-disclaimer.phphttp://www.cdbsoftware.com/supporthttp://www.cdbsoftware.com/contact-us.phphttp://www.cdbsoftware.com/become-a-partner.phphttp://www.cdbsoftware.com/policies-and-guidelines.phphttp://www.cdbsoftware.com/real-time-db2-data-management-solution.phphttp://www.cdbsoftware.com/about-cdb.phphttp://www.cdbsoftware.com/webcasts.phphttp://www.cdbsoftware.com/index.phphttp://www.cdbsoftware.com/about-cdb.phphttp://www.cdbsoftware.com/press-contacts.phphttp://www.cdbsoftware.com/white-papers-and-articles.phphttp://www.cdbsoftware.com/press-releases.php