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



Hi,

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

We made a (read-) trigger pgm that writes the record and some ctrl data to a
logfile.

If an application takes a record in Update-lock (non exclusive lock) during
a transaction,
and at the same time the  (read)-Trigger is 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?

luc




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.