DB2 Triggers not always firing

230 pts.
Tags:
AS 400
DB2
iSeries
When EDI writes our order detail lines to the physical file which is triggered, the triggers are not firing. However, when entering detail lines through a screen the triggers fire and and all is well. Through journals I can see the EDI program is writing all lines in  probably less than 1 second and that's when the triggers are not firing. We are writing up to 20 lines for 1 order. Can records be written so fast that the triggers won't fire?
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

We have a process for processing orders via an EDI interface with our i-Series. The thing with the trigger is we have it on an order control file that does a SBMJOB to the i-Series for processing. Not knowing the specific needs of firing a trigger on every detail line I might consider putting the trigger on another file.  Regardless, I don’t think it should be a problem unless you have logicals involved or jobs running concurrently. 

Discuss This Question: 6  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TheRealRaven
    No. That would've been seen very soon after triggers were first made available (if not in stress-testing long before release). Please post the trigger definition. There might be possibilities depending on the selection of trigger attributes.
    34,530 pointsBadges:
    report
  • GregManzo
    You can't write records "too fast for triggers" because the trigger is called synchronously, ie: the before trigger is called (and has an opportunity to modify the record), then the record is written to the database, then the after trigger, then finally control is returned to the application.
    If your triggers aren't firing there must be something wrong with the setup. Post the definitions so we can see. (with luck it will be something simple)
    2,950 pointsBadges:
    report
  • UARTJ
    Hre is the actual trigger 


    5770SS1 V7R1M0 100423 Display File Description 11/02/18 8:39:58 Page 1
    File . . . . . . . . . . . : ORLINE
    Library . . . . . . . . . : OWDATA
    Type of information . . . . : *TRG
    File attributes . . . . . . : *ALL
    System . . . . . . . . . . : *LCL
    Processor . . . . . . . . . : IBM AS/400 Display File Description Processor
    File . : ORLINE Library . : OWDATA Type of file . : Physical *DATA Auxiliary Storage Pool ID . : 00001
    Trigger Description
    Trigger name . . . . . . . . . . . . . . . : TRG QSYS_TRIG_OWDATA_
    ____ORLINE_____000001
    Trigger library . . . . . . . . . . . . . : OWDATA
    Trigger state . . . . . . . . . . . . . . : STATE *ENABLED
    Trigger status . . . . . . . . . . . . . : *OPERATIVE
    Trigger event . . . . . . . . . . . . . . : TRGEVENT *INSERT
    Trigger time . . . . . . . . . . . . . . : TRGTIME *BEFORE
    Allow repeated change . . . . . . . . . . : ALWREPCHG *NO
    Program Name . . . . . . . . . . . . . . : PGM I3ORDLC1
    Library . . . . . . . . . . . . . . . . : PRODUCTION
    Program is threadsafe . . . . . . . . . . : THDSAFE *UNKNOWN
    Multithreaded job action . . . . . . . . : MLTTHDACN *SYSVAL
    Trigger type . . . . . . . . . . . . . . : *SYS
    Trigger orientation . . . . . . . . . . . : *ROW
    Trigger creation date and time . . . . . : 10/13/18 11:01:41
    Number of trigger update columns . . . . : 0
    Trigger name . . . . . . . . . . . . . . . : TRG QSYS_TRIG_OWDATA_
    ____ORLINE_____000002
    Trigger library . . . . . . . . . . . . . : OWDATA
    Trigger state . . . . . . . . . . . . . . : STATE *ENABLED
    Trigger status . . . . . . . . . . . . . : *OPERATIVE
    Trigger event . . . . . . . . . . . . . . : TRGEVENT *UPDATE
    Trigger time . . . . . . . . . . . . . . : TRGTIME *BEFORE
    Allow repeated change . . . . . . . . . . : ALWREPCHG *NO
    Trigger update condition . . . . . . . . : TRGUPDCND *ALWAYS
    Program Name . . . . . . . . . . . . . . : PGM I3ORDLC1
    Library . . . . . . . . . . . . . . . . : PRODUCTION
    Program is threadsafe . . . . . . . . . . : THDSAFE *UNKNOWN
    Multithreaded job action . . . . . . . . : MLTTHDACN *SYSVAL
    Trigger type . . . . . . . . . . . . . . : *SYS
    Trigger orientation . . . . . . . . . . . : *ROW
    Trigger creation date and time . . . . . : 10/13/18 11:01:41
    Number of trigger update columns . . . . : 0
    Trigger name . . . . . . . . . . . . . . . : TRG QSYS_TRIG_OWDATA_
    ____ORLINE_____000003
    230 pointsBadges:
    report
  • UARTJ
    Sorry the first paste did not have the whole file this does.

    Add
    5770SS1 V7R1M0 100423 Display File Description 11/02/18 8:39:58 Page 1
    File . . . . . . . . . . . : ORLINE
    Library . . . . . . . . . : OWDATA
    Type of information . . . . : *TRG
    File attributes . . . . . . : *ALL
    System . . . . . . . . . . : *LCL
    Processor . . . . . . . . . : IBM AS/400 Display File Description Processor
    File . : ORLINE Library . : OWDATA Type of file . : Physical *DATA Auxiliary Storage Pool ID . : 00001
    Trigger Description
    Trigger name . . . . . . . . . . . . . . . : TRG QSYS_TRIG_OWDATA_
    ____ORLINE_____000001
    Trigger library . . . . . . . . . . . . . : OWDATA
    Trigger state . . . . . . . . . . . . . . : STATE *ENABLED
    Trigger status . . . . . . . . . . . . . : *OPERATIVE
    Trigger event . . . . . . . . . . . . . . : TRGEVENT *INSERT
    Trigger time . . . . . . . . . . . . . . : TRGTIME *BEFORE
    Allow repeated change . . . . . . . . . . : ALWREPCHG *NO
    Program Name . . . . . . . . . . . . . . : PGM I3ORDLC1
    Library . . . . . . . . . . . . . . . . : PRODUCTION
    Program is threadsafe . . . . . . . . . . : THDSAFE *UNKNOWN
    Multithreaded job action . . . . . . . . : MLTTHDACN *SYSVAL
    Trigger type . . . . . . . . . . . . . . : *SYS
    Trigger orientation . . . . . . . . . . . : *ROW
    Trigger creation date and time . . . . . : 10/13/18 11:01:41
    Number of trigger update columns . . . . : 0
    Trigger name . . . . . . . . . . . . . . . : TRG QSYS_TRIG_OWDATA_
    ____ORLINE_____000002
    Trigger library . . . . . . . . . . . . . : OWDATA
    Trigger state . . . . . . . . . . . . . . : STATE *ENABLED
    Trigger status . . . . . . . . . . . . . : *OPERATIVE
    Trigger event . . . . . . . . . . . . . . : TRGEVENT *UPDATE
    Trigger time . . . . . . . . . . . . . . : TRGTIME *BEFORE
    Allow repeated change . . . . . . . . . . : ALWREPCHG *NO
    Trigger update condition . . . . . . . . : TRGUPDCND *ALWAYS
    Program Name . . . . . . . . . . . . . . : PGM I3ORDLC1
    Library . . . . . . . . . . . . . . . . : PRODUCTION
    Program is threadsafe . . . . . . . . . . : THDSAFE *UNKNOWN
    Multithreaded job action . . . . . . . . : MLTTHDACN *SYSVAL
    Trigger type . . . . . . . . . . . . . . : *SYS
    Trigger orientation . . . . . . . . . . . : *ROW
    Trigger creation date and time . . . . . : 10/13/18 11:01:41
    Number of trigger update columns . . . . : 0
    Trigger name . . . . . . . . . . . . . . . : TRG QSYS_TRIG_OWDATA_
    ____ORLINE_____000003
    5770SS1 V7R1M0 100423 Display File Description 11/02/18 8:39:58 Page 2
    File . : ORLINE Library . : OWDATA Type of file . : Physical *DATA Auxiliary Storage Pool ID . : 00001
    Trigger Description
    Trigger library . . . . . . . . . . . . . : OWDATA
    Trigger state . . . . . . . . . . . . . . : STATE *ENABLED
    Trigger status . . . . . . . . . . . . . : *OPERATIVE
    Trigger event . . . . . . . . . . . . . . : TRGEVENT *DELETE
    Trigger time . . . . . . . . . . . . . . : TRGTIME *BEFORE
    Allow repeated change . . . . . . . . . . : ALWREPCHG *NO
    Program Name . . . . . . . . . . . . . . : PGM I3ORDLC1
    Library . . . . . . . . . . . . . . . . : PRODUCTION
    Program is threadsafe . . . . . . . . . . : THDSAFE *UNKNOWN
    Multithreaded job action . . . . . . . . : MLTTHDACN *SYSVAL
    Trigger type . . . . . . . . . . . . . . : *SYS
    Trigger orientation . . . . . . . . . . . : *ROW
    Trigger creation date and time . . . . . : 10/13/18 11:01:41
    Number of trigger update columns . . . . : 0your reply...
    230 pointsBadges:
    report
  • ToddN2000
    Try running you EDI process through debug to verify the trigger is working. Make sure it's writing to the correct file in the correct library and not a work file then moved into production like out work flow does. Also what is the trigger program doing? The reason I ask it you have your trigger set to fire on *BEFORE. If the trigger program is fired and looking for a record that doesn't not exist yet that may be your problem,
    131,645 pointsBadges:
    report
  • GregManzo
    Your setup looks good. It may be that your trigger _is_ firing but for some reason isn't working as promised. (note that if the trigger actually crashed, the I/O would fail). I think your next step is to attempt to debug it to see what's happening on the inside.
    2,950 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: