|
First and foremostly never put a trigger program directly on a table.
Always have a Mediator.
A Mediator is a very small program that does nothing except call another
program or service program and does as little as possible.
I use a Trigger Mediator. You will find an older version of it at
www.think400.dk/downloads.htm.
I have been trying to get the new version out but just haven't had the
time.
In any case, the program that you physically wire to the database should do
as little as possible.
If you want further information, please let me know.
On Tue, Jun 8, 2021 at 1:48 PM Steinmetz, Paul via MIDRANGE-L <
midrange-l@xxxxxxxxxxxxxxxxxx> wrote:
We use triggers on a few of our files.not
A 3rd party app upgrade removed the triggers, we were not aware.
To add them back in, due to the object locks, I had to bring the LPAR to
restricted state to add the triggers with no issues.
Not the answer you wanted to hear.
Paul
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of
Robert Rogerson
Sent: Tuesday, June 8, 2021 4:43 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx
Subject: ADDPFTRG and record lock...
________________________________
CAUTION: This email originated from outside of the PENCOR network. Do
click on any links or open attachments unless the sender is known, andthe
content is verified as safe.small
________________________________
Hi all,
I need some help figuring this out. I am attempting to add an after
insert trigger to a file that is almost always in use. So I wrote a
CL program to try and do this in a loop. There were actually 3 files butmidnight
each file was handled the same way.
pgm ()
dcl &t2added *lgl 1 VALUE('0')
DclPrcOpt dftactgrp(*no) actgrp(*new)
DoUntil (&t2added)
Dlyjob (60)
If (*not &t2added) Then(Do)
/* Add trigger to ITEMP */
ADDPFTRG FILE(&library/UPCITMP) TRGTIME(*AFTER) +
TRGEVENT(*INSERT) PGM(VPE172) TRG(TRG_VPE172_INS) RPLTRG(*YES)
Monmsg CPF32C6 Exec(goto ENDTRG)
Chgvar &t2added '1'
Enddo
ENDTRG:
Enddo
endpgm
I submitted this program at 14:45 yesterday afternoon. It ran for over 9
hours with no errors nor did it cause any errors. Then just after
we began getting programs (not this trigger adding program) failing dueto
not being OPEN (RPG opcode) a logical over the physical I was trying toadd
the trigger to. As this happened after midnight a number of jobs failedtrigger
when not able to open the logical. As soon as I cancelled the add
program the OPEN in the other jobs stopped failing.unable
In my dev environment I ran the program to add the triggers and was
to create a lock by the add trigger program when trying the ADDPFTRGadd
command.
Is there any way that the ADDPRFTRG command can lock a logical but not
the trigger (CPF32C6)?subscribe,
Thanks,
Rob
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To
unsubscribe, or change list options,list
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx--
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.
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.