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



Alan,

I have had a short look to think400 and now I maybe understand why you don't want to run the Trigger Mediator in the DFT ACTGRP. IMHO the starting point to solve it all, is in deed to run the trigger mediator in a named ACTGRP. As a conclusion of this, your database changes from the SRVPGMs are not part of the surrounding transaction and hanging until the ACTGRP disappears; by default they are rollbacked at abnormal end by the system and commited by default at RCLACTGRP by the user (funny these defaults!!!). The only chance I see is (as posted earlier) to use the register commit ressource API, so the system will tell your call back routine, that the surrounding transaction is ended and wether it was commit, or rollback and the trigger mediator could doe the appropriate close of the transaction.

@dynamic loading: I have had a discussion with Mihael on this topic and we did not come to a final result. For components (in other words: the public interfaces of published components) it must be encapsulated in the components (as long as the RPG Compiler isn't enhanced at this point). Reading from your problems this would mean: don't throw an error in a SRVPGM opening a named ACTGRP. Maybe you could decouple the dependencies by a facade running in ACTGRP *CALLER and the SRVPGM behind this running in a named ACTGRP (I remeber this was Miahels approach).

Dieter



--------------------------------------------------
From: "Alan Campin" <alan0307d@xxxxxxxxx>
Sent: Thursday, October 07, 2010 2:09 AM
To: "RPG programming on the IBM i / System i" <rpg400-l@xxxxxxxxxxxx>
Subject: Re: avoid running ILE programs in the DAG...

I use the same trick in service programs I have on the web. I call them
XVRLSV (Resolve to object) and XVDYNL (Dynamically load server program. They
are freely available on the web at www.think400.dk/downloads.htm as part of
the trigger mediator package.

The trigger mediator uses them to load the correct service program from the
database.

The problem becomes all of the other service programs that get called at
every level. Everyone would have to be loaded dynamically. A rule pain to
say the least and all procedure calls would have to made through the
dynamically load service program which means every procedure used in every
service program would have to be resolved and address stored and used to
call it. I am not sure that is practical.

On Wed, Oct 6, 2010 at 4:57 PM, <dieter.bender@xxxxxxxxxxxx> wrote:

... sounds like best way to use PROCP4NAME, so you could put the knowledge
about whiich trigger to call in an external configuration (database or
properties), evaluated at runtime and thsi could solve the issue with
"destroyed" ACTGRPs too.

Dieter

--------------------------------------------------
From: "Alan Campin" <alan0307d@xxxxxxxxx>
Sent: Thursday, October 07, 2010 12:36 AM
To: "RPG programming on the IBM i / System i" <rpg400-l@xxxxxxxxxxxx>
Subject: Re: avoid running ILE programs in the DAG...

> A bit more complicated.
>
> 1. Trigger Mediator. Written in ILE RPG.
> 2. Service programs written in ILE RPG using SQL for I/O
>
> Java program issues an SQL Insert or Update which runs in the QDASOINIT
> job.
> This fires the trigger mediator which knows which service program to > call
> for that table.
>
> Updates are made to tables using SQL but nothing is commited. It > returns
> to
> Java client which either issues a COMMIT or ROLLBACK. Again those
> statements
> run in the QDASOINIT job.
>
> I have no choice about where IBM runs there statements. They always run
in
> the QDASOINIT jobs and under the default activation group.
>
> I just end up with problems if I try to run the trigger service > programs
> in
> anything except the default activation group.
>
> On Wed, Oct 6, 2010 at 4:12 PM, <dieter.bender@xxxxxxxxxxxx> wrote:
>
>> just to clearify:
>> - you have trigger programms written in ILE RPG
>> - you have RPG programms, using SQL registered as external stored
>> procedure
>> - this programms are using SRVPGMs
>> - you access DB2 from some Java Client under Commitment controll
>> and you don't want to run these programs in the default activation
group?
>>
>> D*B
>>
>> --------------------------------------------------
>> From: "Alan Campin" <alan0307d@xxxxxxxxx>
>> Sent: Wednesday, October 06, 2010 9:27 PM
>> To: "RPG programming on the IBM i / System i" <rpg400-l@xxxxxxxxxxxx>
>> Subject: Re: avoid running ILE programs in the DAG...
>>
>> > The commitment control is coming from a client job. I should have >> > made
>> > that
>> > clear. Client jobs run in a default activation group in a QDASOINIT
>> > job.
>> > Commitment control did not work for the client program to roll back
>> > changes
>> > in the trigger program unless it ran in the DAG group.
>> >
>> > The error handling is another issue. If someone has a better way I
>> > would
>> > be
>> > glad to hear it.
>> >
>> > When you have an error in a trigger program, the only way that you
>> > signal
>> > back to the caller is by throwing an exception message. When you >> > throw
>> > back
>> > an error and you are running in a named activation and that named
>> > activation
>> > is not being used higher up the stack is destroys the named >> > activation
>> > group
>> > and the next time you try to call it you are not going to find the
>> service
>> > program because the activation group is gone.
>> >
>> > You will have the same behavior if you have a program running in a
>> > named
>> > activation group and it calls a service program running in a another
>> named
>> > activation group (Say QILE calling a service program running >> > QSRVPGM).
>> > If
>> > both are running in QILE and the error occurs or you simply signal >> > an
>> > error
>> > there is no problem but run them separate and boom.
>> >
>> > As far as I am concerned this is bizarre behavior. If I am using the
>> > activation group in the caller why is the activation group good and >> > I
>> > can
>> > continue to use it but it is not any good when I running another
>> > activation
>> > group? Why destroy the activation group at all?
>> >
>> > We also found this behavior happening when we had programs calling
>> > COBOL
>> > program that did a STOP UNIT(I think that is right). That destroyed
the
>> > activation group and we had problems with programmers doing >> > RCLACTGRP
>> > (Vendor and ours) at the end of a program.
>> >
>> > We spent hours and hours and hours talking to IBM about all this >> > stuff
>> and
>> > the only solution they could give us was to run in the DAG which I
hate
>> to
>> > do.
>> >
>> > All our programs are written 100% in modern RPG using ILE call >> > models,
>> > service programs and SQL.
>> >
>> > If someone else has a better solution I would sure like to hear it.
>> >
>> > On Wed, Oct 6, 2010 at 12:02 PM, Wintermute, Sharon <
>> > Sharon.Wintermute@xxxxxxx> wrote:
>> >
>> >> I wonder if the OP is using CLP instead of CLLE routines to start
>> >> commitment control. The CLLE should use the same named AG as the >> >> rpg
>> >> routine.
>> >>
>> >> Sharon Wintermute
>> >>
>> >>
>> >> -----Original Message-----
>> >> From: rpg400-l-bounces@xxxxxxxxxxxx
>> >> [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Mark >> >> Murphy/STAR
>> >> BASE Consulting Inc.
>> >> Sent: Wednesday, October 06, 2010 12:55 PM
>> >> To: RPG programming on the IBM i / System i
>> >> Subject: RE: avoid running ILE programs in the DAG...
>> >>
>> >> Yes it works on named activation groups. The commit scope can be >> >> the
>> >> activation group it was started in (this is the default), or the >> >> job.
>> >> If Alan was using mixed activation groups (some programs OPM, some
>> >> programs ILE with named activation group), he might think that
>> >> commitment control was not working, but in actuality it was doing
just
>> >> what he told it to do. To cover the entire job in such a mixed
>> >> environment you need to use STRCMTCTL CMTSCOPE(*JOB).
>> >>
>> >> Mark Murphy
>> >> STAR BASE Consulting, Inc.
>> >> mmurphy@xxxxxxxxxxxxxxx
>> >>
>> >> -----rpg400-l-bounces@xxxxxxxxxxxx wrote: -----
>> >>
>> >> To: "RPG programming on the IBM i / System i" >> >> <rpg400-l@xxxxxxxxxxxx
>
>> >> From: "Wintermute, Sharon" <Sharon.Wintermute@xxxxxxx>
>> >> Sent by: rpg400-l-bounces@xxxxxxxxxxxx
>> >> Date: 10/06/2010 01:39PM
>> >> Subject: RE: avoid running ILE programs in the DAG...
>> >>
>> >> I use commitment control within named AGs all the time. It does >> >> work.
>> >>
>> >>
>> >> Sharon Wintermute
>> >>
>> >> -----Original Message-----
>> >> From: rpg400-l-bounces@xxxxxxxxxxxx
>> >> [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Bryce Martin
>> >> Sent: Wednesday, October 06, 2010 12:31 PM
>> >> To: RPG programming on the IBM i / System i
>> >> Subject: Re: avoid running ILE programs in the DAG...
>> >>
>> >> Why not have a cleanup program for each service program so that if >> >> it
>> >> ends
>> >> in error you won't have any junk laying around. What exactly were
you
>> >> pointing to that you got a pointer crash? I write all my new code >> >> in
>> >> named AG's, and trust me, when I'm developing they crash and burn.
>> >> But
>> >> I
>> >> don't ever have trouble running the program again. Are you trying >> >> to
>> >> trap
>> >> the error and continue? Or are you describing just rerunning the
>> >> program?
>> >> I'm guessing you are missing a critical piece. You should no way >> >> no
>> >> how
>> >> need to run your service programs in the DAG.
>> >>
>> >> Can anyone else verify if commitment control will or won't work in
>> >> named
>> >>
>> >> AG's? I can't hardly believe that. I know most i shops don't use
CC,
>> >> but
>> >> this would seem like a huge oversight on IBM's part.
>> >>
>> >>
>> >> Thanks
>> >> Bryce Martin
>> >> Programmer/Analyst I
>> >> 570-546-4777
>> >>
>> >>
>> >>
>> >> Alan Campin <alan0307d@xxxxxxxxx>
>> >> Sent by: rpg400-l-bounces@xxxxxxxxxxxx
>> >> 10/06/2010 12:35 PM
>> >> Please respond to
>> >> RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>
>> >>
>> >>
>> >> To
>> >> "RPG programming on the IBM i / System i" <rpg400-l@xxxxxxxxxxxx>
>> >> cc
>> >>
>> >> Subject
>> >> Re: avoid running ILE programs in the DAG...
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> We had to put our service programs back into DAG because commitment
>> >> control
>> >> would not work unless the program was running DAG.
>> >>
>> >> We also ran into big problems with errors in named activation >> >> groups.
>> >> Every
>> >> time that an error is thrown in a named activation group the system
>> >> destroys
>> >> the activation group and when you try to go back to it the program
>> >> crashes
>> >> because the pointer is now pointing at a object that doesn't exist
>> >> anymore.
>> >>
>> >> The only way we could seem to get around this was to run the >> >> service
>> >> program
>> >> and programs in the DAG so that it could not destroy the activation
>> >> group.
>> >>
>> >> Totally bizarre behavior on IBM's part. Errors occur all the time.
Why
>> >> destroy the activation group but that what they do.
>> >>
>> >> I don't like running everything in the DAG but pretty much have no
>> >> choice.
>> >>
>> >> On Wed, Oct 6, 2010 at 8:12 AM, Stefano Arrighini - Smea s.r.l. <
>> >> s.arrighini@xxxxxxx> wrote:
>> >>
>> >> > Hi to all
>> >> >
>> >> > Some years ago all ours programs ran in the DAG.
>> >> >
>> >> > In the past two years we "introduced" Activation Group in some
>> >> programs
>> >> > (some in named AG, other in temporary ones).
>> >> > We made this for various reason (avoid recursion, improve
>> >> performance,
>> >> > etc.).
>> >> >
>> >> > Unfortunately (or better... by ignorance...) we made this
>> >> > operation
>> >> > without having well understood Activation Groups.
>> >> >
>> >> > Now I'm trying to do spring cleaning...
>> >> >
>> >> > In all (or almost) technical articles and forum I read, I found
>> >> > the
>> >> > advice
>> >> > to avoid running ILE programs in the DAG.
>> >> >
>> >> > So we modified our programs to run all of them in Named
Activation
>> >> Group
>> >> > (or Temporary) and not in the DAG.
>> >> > None of our programs are compilated with DFTACTGRP(*YES)!!
>> >> > So I simply replaced *CALLER with Named-one in the ACTGRP >> >> > option
>> >> > of
>> >> ours
>> >> > "starting program" (the first program in the call stack of ours
>> >> job).
>> >> >
>> >> > I found lots of advantages... but this operation introduced >> >> > some
>> >> problem
>> >> > with OVRDBF scoping.
>> >> >
>> >> > To avoid this problem I changed the OVRDBF (and OVRPRTF and
>> >> > DLTOVR)
>> >> with
>> >> > scoping problem.
>> >> >
>> >> > A make an OVRPRTF and calls B
>> >> > B calls C
>> >> > C is in a different AG and isn't affected by OVRPRTF. But I >> >> > want
>> >> > it.
>> >> >
>> >> > OVRPRTF OVRSCOPE(*CALLLVL) was my solution..
>> >> >
>> >> > Now my MAIN question is...
>> >> > Compiling all my existing program in a proper Activation Group
>> >> > (not
>> >> in
>> >> > the
>> >> > DAG), how many other problem can produce?
>> >> >
>> >> > For example I found some difference in "free resources".
>> >> > The RCLRSC LVL(*CALLER) used in the DAG can't be "replaced" >> >> > with
a
>> >> > similar
>> >> > command in a Named AG...
>> >> > I have to close the Activation Group... Right?
>> >> >
>> >> > Any help or observation would be greatly appreciated.
>> >> > Thanks in advance
>> >> >
>> >> > Stefano
>> >> > --
>> >> > This is the RPG programming on the IBM i / System i (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.
>> >> >
>> >> >
>> >> --
>> >>
>> >> This is the RPG programming on the IBM i / System i (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.
>> >>
>> >>
>> >>
>> >> --- This message (including any attachments) is intended only for >> >> the
>> >> use of the individual or entity to which it is addressed and may
>> >> contain
>> >> information that is non-public, proprietary, privileged,
confidential,
>> >> and exempt from disclosure under applicable law. If you are not the
>> >> intended recipient, you are hereby notified that any use,
>> >> dissemination,
>> >> distribution, or copying of this communication is strictly
prohibited.
>> >> If you have received this communication in error, please notify us
and
>> >> destroy this message immediately. ---
>> >> --
>> >>
>> >> This is the RPG programming on the IBM i / System i (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.
>> >>
>> >> --
>> >>
>> >> This is the RPG programming on the IBM i / System i (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.
>> >>
>> >>
>> >> --
>> >> This is the RPG programming on the IBM i / System i (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.
>> >>
>> >> --
>> >> This is the RPG programming on the IBM i / System i (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.
>> >>
>> >>
>> > --
>> > This is the RPG programming on the IBM i / System i (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.
>> >
>> >
>> --
>> This is the RPG programming on the IBM i / System i (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.
>>
>>
> --
> This is the RPG programming on the IBM i / System i (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.
>
>
--
This is the RPG programming on the IBM i / System i (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.


--
This is the RPG programming on the IBM i / System i (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 ...

Follow-Ups:
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.