× 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.



I kept working on it and got it figured out.

I have BLOCK(*NO) on the file to prevent the buffered I/O. You are correct 
it did fire the trigger and went through all the motions, but no TESTH 
record was produced.  I even signed off the session to make sure the job 
flushes.  What I had to do was detect a switch in commitment control in 
the trigger and close and re-open the file without commitment control.  I 
was hoping I wouldn't have to, but it works.

I have one last hic-up to get past now.  I can't execute an ENDCMTCTL even 
with everything committed because TESTH is still open.  I know I can run 
my program in a specific activation group, compile the trigger with 
activation group *CALLER and then end the activation group, but I am 
wondering if there is a better way.

I haven't even begun to see how embedded SQL will work with this...since 
you can specify commitment control in-line with the SQL statement.

Anyone know of an advanced IBM class that addresses this topic?

Thanks in advance,

Mark

> ----- Message from "Lim Hock-Chai" <Lim.Hock-Chai@xxxxxxxx> on Wed, 
> 29 Sep 2004 15:28:39 -0500 -----
> 
> To:
> 
> "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
> 
> Subject:
> 
> RE: Commitment control and open data paths with triggers
> 
> As far as I know, it will always fire the trigger program. 
> Commitment control has no effect on it.
> 
> Did you put the trigger program in debug to make sure that it really
> did not call it?  My guess is that the trigger program opens the 
> file for output only, which cause the data to be held in the buffer.
> 
> 
> 
> -----Original Message-----
> From: rpg400-l-bounces@xxxxxxxxxxxx
> [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Mark Adkins
> Sent: Wednesday, September 29, 2004 3:01 PM
> To: rpg400-l@xxxxxxxxxxxx
> Subject: Commitment control and open data paths with triggers
> 
> 
> I have been reading documentation and setting up test scenarios all day 
> and can't get past this last obstacle.
> 
> I have a file called TEST with an RPGLE deletion trigger to write a 
> history file TESTH.  In the trigger, TESTH is left open for performance. 
I 
> have a little test program that takes the commitment control flag as an 
> entry parm.  It deletes a record and then rolls back.  When I call the 
> program with commitment control on, it fires the trigger and rolls back 
> just fine.  In the same job, when I then call the program with 
commitment 
> control off, it deletes the record but never fires the trigger.  Keep in 

> mind that I have to execute STRCMTCTL before running the program for the 

> first time and can not ENDCMTCTL between the calls because TESTH is 
still 
> open.
> 
> This is a tough one.  My everlasting gratitude to anyone who can help me 

> get past this.
> 
> Regards,
> 
> Mark

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.