• Trigger blocks our AS400 applications

    From pandey.utkarsh@gmail.com@21:1/5 to news.wplus.ne on Tue Sep 24 01:08:21 2019

    We are facing the same issue. Can you please let us know how issue was resolved. Thanks


    On Friday, March 25, 2005 at 8:54:42 PM UTC+5:30, news.wplus.ne wrote:

    We need to log every access on a specific (main)-file of our system.
    (not our choice, but a demand of a business partner)
    The only way to accomplish this, that we know of, is using a read-trigger.

    So we did some tests (V5R2).

    If an application takes a record in Update-lock (non exclusive lock) during
    a transaction,
    and at the same time there is a (read)-Trigger actif,
    no Query, Read, ODBC or whatever can read the File beyond that record.

    CPF5027 "Record in use" ,errorcode = 2
    job ####/user/$$$$$$$ was not waiting on a lock held by this job

    If I remove the trigger, everything works as expected.
    The indicated job is the one that has read the record for update.
    "This job" did not take any lock.

    Even worse, with not any used record (not in update nor in read),
    if we want to access the file using a Join Logical file ,
    the Read instruction blocks before any read has been done .

    MCH3601, pointer not set in QSYS/QDBGETKY
    RMVPFTRG and all reads work fine again ...

    If I want to access the file (FLI) via a simple Query and a record has been taken for update in another session
    "runqry qry(*NONE) qryfile(FLI)" I get the error QRY5050 .
    Commitment control with lock level *ALL is active .

    The read-trigger apparently changes the commitlevel to *ALL ,
    as for me, there is not any reason to do so.

    Is there another way to log all accesses on a file (without affecting other files in the database)
    Is there any circumvention for this misbehaviour of the triggerlogic?


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)