I have written code to run in both UniData and UniVerse for tracking
audit information within triggers.. In order to maintain a decent
performance level by avoiding repetitive and expensive file opens, we
use either a set of known named common variables for specific files, or
we have a generic caching mechanism using named common that keeps files
open for as long as there is activity within the application..

Basically, in the caching mode, we have a rotating list of 20 file
handles that can be active at any point in time. All file opens are done
via a standard open subroutine, which checks the cache list first for
the file handle, and if found bumps its "priority" to ensure it remains
in cache before returning the handle, if not found in cache the
subroutine will open the file and optionally add its handle to cache for
future use. If the cache is full, the file at the bottom of the list is
dropped and flagged to be closed.. When the accompanying close
subroutine is called, if the item is no longer on the cache, the file is
closed.

HTH

Ray


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of George Gallen
Sent: 30 October 2009 15:38
To: U2 Users List
Subject: Re: [U2] Universe Triggers

is the trigger program doing any file opens? That would probably be your
slow down.

I've not tried to setup a common with any of the triggers I've setup,
since the number
of writes has been minimal for us (maybe 5 per hour maximum).

George

> -----Original Message-----
> From: [email protected] [mailto:u2-users-
> [email protected]] On Behalf Of Curt Stewart
> Sent: Friday, October 30, 2009 10:47 AM
> To: [email protected]
> Subject: [U2] Universe Triggers
>
> I'm testing using triggers to maintain an Audit log of transactions.
> Everything works, the file, the subroutine, but the trigger process is
> extremely slow.
>
> My test program loops through 1 to 10000 and writes a record to my
test
> file
> with the trigger.  Without the trigger in place the program runs in 2
> seconds, with the trigger in place the program runs in 25 seconds.
The
> timings are roughly the same if the trigger program is doing nothing
> more
> than a return.  I've also tested calling the trigger subroutine from
> the
> program (without the trigger on the file) and the process runs in 2-3
> seconds.
>
> This is Universe 10.2.10 on a virtual Windows 2003 server.  The
trigger
> file
> is type 18 and the trigger was created with this statement;
> CREATE TRIGGER AUDIT_LOG BEFORE UPDATE OR INSERT OR DELETE ON
> TEST.TRIGGER.FILE FOR EACH ROW CALLING '*apps*AUDIT.LOG.TRIGGER';
>
> It appears that just calling a trigger significantly degrades the
> process.
> Does anyone have any ideas or suggestions.
>
> Thanks for any help you can provide.
> Curt
>
> _______________________________________________
> U2-Users mailing list
> [email protected]
> http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to