.st0{fill:#FFFFFF;}

Commitment Control on the old AS400 and iSeries machines 

 January 18, 2013

By  NickLitten

another snippet from an old document I found in a dim dark and hazy corner of an even older HDD… rather than let it disintegrate, here it is migrating to the web just in the (extreme) off chance that it may be useful to someone out there. Hey.. if YOU are reading this then its done its job šŸ˜‰

Commitment control lets you define and process a number of changes to database files in a single unit (transaction). Commitment control can ensure that complex application transactions are logically synchronized, even if the job or system ends. Two-phase commitment control ensures that committable resources, such as database files on multiple systems, remain synchronized.

Transactions

A transaction is a group of changes that appear as a single change, such as the transfer of funds from a savings account to a checking account. Transactions can be classified as follows:

  • Inquiries in which no file changes occur.
  • Simple transactions in which one file is changed each time you press the Enter key.
  • Complex transactions in which two or more files are changed each time you press the Enter key.
  • Complex transactions in which one or more files are changed each time you press the Enter key. These changes represent only part of a logical group of transactions.

Revisions made to files during transaction processing are journalled when using commitment control.

If the system or job ends abnormally, journaling alone can ensure that, at most, only the very last record change is lost. However, if the system or job ends abnormally during a complex transaction, the files reflect an incomplete logical transaction. For example, the job may have updated a record in file A, but before it updated a corresponding record in file B, the job ended abnormally. In this case, the logical transaction consisted of two updates, but only one update completed before the job ended abnormally.

Benefits of using commitment control

Recovering a complex application requires detailed application knowledge. Programs cannot be restarted. For example, record changes may have to be made with an application program or data file utility to reverse the files to just before the last complex transaction began. This task becomes more complex if multiple users were accessing the files at the same time.

Commitment control helps solve these problems. Commitment control locks records from other users during a complex transaction. This ensures that other users do not use the records until the transaction is complete. At the end of the transaction, the program issues the commit operation, freeing the records. However, should the system end abnormally before performing the commit operation, all record changes for that job since the last time a commit operation occurred are rolled back. Any affected records that are still locked are then unlocked. In other words, database changes roll back to a clean transaction boundary.

NickLitten


IBM i Software Developer, Digital Dad, AS400 Anarchist, RPG Modernizer, Shameless Trekkie, Belligerent Nerd, Englishman Abroad and Passionate Eater of Cheese and Biscuits. Nick Litten Dot Com is a mixture of blog posts that can be sometimes serious, frequently playful and probably down-right pointless all in the space of a day. Enjoy your stay, feel free to comment and remember: If at first you don't succeed then skydiving probably isn't a hobby you should look into.

Nick Litten

related posts:

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
__CONFIG_colors_palette__{"active_palette":0,"config":{"colors":{"cff50":{"name":"Main Accent","parent":-1},"a344d":{"name":"Accent Transparent","parent":"cff50"}},"gradients":[]},"palettes":[{"name":"Default","value":{"colors":{"cff50":{"val":"var(--tcb-skin-color-0)"},"a344d":{"val":"rgba(46, 138, 229, 0.85)","hsl_parent_dependency":{"h":210,"l":0.54,"s":0.78}}},"gradients":[]},"original":{"colors":{"cff50":{"val":"rgb(0, 178, 255)","hsl":{"h":198,"s":1,"l":0.5}},"a344d":{"val":"rgba(0, 178, 255, 0.85)","hsl_parent_dependency":{"h":198,"s":1,"l":0.5}}},"gradients":[]}}]}__CONFIG_colors_palette__

Get In Touch

Iā€™m always looking for awesome input, feedback and critique!

>