Many things to ponder.

Thanks for all the input.

I’ll actually get a chance to do some trigger testing with this program next week.

The good thing is this is new stuff as part of a modernization project.

Regards,
Richard Schoen
Web: http://www.richardschoen.net
Email: richard@xxxxxxxxxxxxxxxxx

------------------------------

message: 5
date: Thu, 9 Apr 2026 19:02:28 -0700
from: x y <xy6581@xxxxxxxxx>
subject: Re: Question on SQL After Trigger Locking a Record

I'm with Daniel: this sounds like a commitment control ("transaction")
issue and SQL loves to commit. Mixing OPM and SQL seems like a dog's
breakfast but sometimes such situations are out of our control.

Ideas:
1) Add a COMMIT=*NO to the SQL trigger program (but don't know if you can
do it).
2) Create the trigger program with the *DFT activation group so the trigger
runs in the same activation group as the application (don't know if you can
do this either).
3) Rewrite the trigger in RPG and get your activation groups straight.
4) Execute STRCMTCTL LCKLVL(*CHG) CMTSCOPE(*JOB) when the job initiates.

On Thu, Apr 9, 2026 at 12:08?PM Charles Wilt <charles.wilt@xxxxxxxxx> wrote:

On Thu, Apr 9, 2026 at 11:31?AM Richard Schoen <richard@xxxxxxxxxxxxxxxxx>
wrote:

They are potentially still in the same order doing work once the trigger
goes off.

<snip>

I wonder if a delay for a second after update would help.


I believe you're under the mistaken impression that the trigger is run "out
of band" or asynchronous to the RPG program.

This is not the case. When the RPG WRITE/UPDATE op-code is hit, and
control passes to Db2, control will not return to the RPG program until the
trigger is finished.

Like others, I suspect the program is a mismatch in isolation levels, which
shouldn't occur as an SQL Trigger normally inherits the isolation level of
the application.
With an RPG trigger, you have to have code to check the "Commit Lock Level"
field of the trigger buffer passed in.

It'd be helpful for you to confirm which table/record is being waited on.

Also, it'd be helpful to see the code for the trigger.

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





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