× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Mike,
Totally agree with you.
"...Give some thought as to what you want your "unit of work" to be..."
This is very important.
Commitment control is best used when developing a new application where you
can control the design and where/when IO is done.
My first attempt at using this was a looooooonnnnnnnng time ago and I
foolishly attempted to add it to an existing application without a good
knowledge of how it worked. Had a program in mid-stream blow up when I did
a COMIT too soon.

If one does use it, and understands how it works and the design of the
application, it can be a great tool.


Jeff Young
Sr. Programmer Analyst

On Wed, Nov 18, 2015 at 4:06 PM, Mike Jones <mike.jones.sysdev@xxxxxxxxx>
wrote:

Charles is correct.

I think the first time I used RPG COMMIT and ROLBK op codes, in conjunction
with F-specs, was around 1993. That ability is likely a lot older than
that.

The first time I used that was in a new program posting a daily order
batch. I designed the program to post the entire batch, and at the end,
check to ensure the postings were in balance (debits = credits, plus a few
other ways of balancing).

If the batch was out of balance for any reason, the program would do a
ROLBK of the entire batch, and send a message to QSYSOPR. I would then fix
the root cause of the problem (code and/or data), and resubmit the batch
job. I rolled the entire batch back, because I didn't want to have to
figure out how to post a partial batch in the middle of the night. It
didn't happen often, but when it did, that design made it simple to
recover.

Give some thought as to what you want your "unit of work" to be, as there's
a lot of ways to structure it. The design of the tables and application,
and the volume of data involved, will heavily influence what unit of work
is possible or preferable. Quite a number of times, for developers using
commitment control for the first time, I've seen them code units of work,
that provide little to no assistance during recovery of a failed job or
transaction.

Mike



date: Wed, 18 Nov 2015 14:52:37 -0500
from: Charles Wilt <charles.wilt@xxxxxxxxx>
subject: Re: RPGLE I/O opcodes with commit/rollback

uh....using the COMMIT and ROLBK op-codes?

You have to use the COMMIT keyword on the f-spec for the file.

Or if you're talking RPGIII, the op-codes are COMIT and ROLBK and the
f-spec keyword is done as a continuation line with KCOMIT in position
53-59

Charles

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.