NetTalk Central

Author Topic: Audit Trail and Threads  (Read 3067 times)

Mike McLoughlin

  • Full Member
  • ***
  • Posts: 126
    • View Profile
    • Clarion Templates
    • Email
Audit Trail and Threads
« on: June 11, 2009, 04:22:49 AM »
I've got a procedure which I call (with params detailing filename, field value etc.) whenever a field is changed in any record and it records the change in a log file.

The procedure assumes that the record buffer is still valid when it is called - is that a safe assumption with NTWS?  If every session has its own thread, then doesn't every file have its own (threaded) file buffer in NTWS?

regards

Mike
Mike McLoughlin

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11239
    • View Profile
Re: Audit Trail and Threads
« Reply #1 on: June 11, 2009, 05:42:47 AM »
Every _session_ does not have it's own thread.

Every _request_ has it's own thread. So one session can use a gazillion threads over it's life time. And clarion "reuses" thread numbers, so there's no
session <--> thread link at all.

>> The procedure assumes that the record buffer is still valid when it is called - is that a safe assumption with NTWS?

That depends completely on where you call it from.

Cheers
Bruce


Mike McLoughlin

  • Full Member
  • ***
  • Posts: 126
    • View Profile
    • Clarion Templates
    • Email
Re: Audit Trail and Threads
« Reply #2 on: June 11, 2009, 10:33:30 AM »
I'll do some testing, but I think I should be able to nip out to the log proc, do the business and be back in time for tea - or at least back before some other thread kicks in  ;)

Mike
Mike McLoughlin

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11239
    • View Profile
Re: Audit Trail and Threads
« Reply #3 on: June 12, 2009, 12:34:56 AM »
the Files in your dict should be ,THREADED so there's no need to worry about other threads, unless your logging code is not thread safe. The file structure should not be overwritten by other threads.

Cheers
Bruce