NetTalk Central

Author Topic: Database triggers and Nettalk web handler  (Read 4126 times)

Rob Kolanko

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Database triggers and Nettalk web handler
« on: October 12, 2015, 10:37:05 PM »
Hi,
I would like to use Clarion database triggers to execute code whenever certain tables are maintained. This code will need the to use the Nettalk web handler (p_web) methods.  I think that this can only be done by creating a new file manager class and and a new relation manager class, where the all database methods would need a web handler parameter. Is there an easier way?

Thanks
Rob

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Database triggers and Nettalk web handler
« Reply #1 on: October 13, 2015, 12:22:26 AM »
There is, and I think this will work... But I haven't tried it so tread carefully.

Create a global, threaded (very NB, must be threaded), variable of reference to NetWebServerWorker
let's call it pp_web
so the declaration is

pp_web  &NetWebServerWorker,THREAD

then in WebHandler, immediately after the CODE statement -

pp_web &= p_web

then in your triggers you can reference pp_web and everything should be ok.

cheers
Bruce




Rob Kolanko

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: Database triggers and Nettalk web handler
« Reply #2 on: October 15, 2015, 12:20:02 PM »
I have a problem with the proposed method.
 
pp_web &= p_web

does not compile after the CODE statement in the web handler, because the p_web is not the name of the NetWebServerWorker class in WebHandler. But

pp_web &= ThisNetWorker

seems to work fine.

I have not had the time to figure out why thread pools do not work in my applications yet, but this will be something else to check when I get around to it.

Rob

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Database triggers and Nettalk web handler
« Reply #3 on: October 19, 2015, 11:04:37 PM »
Hi Rob,

you can (and probably should) rename the worker object from ThisNetWorker to p_web on the NetTalk extension on that window. p_web has been the default for a long long time now, although the original default was ThisNetWorker.

There are some advantages when it comes to generated code with having it set as p_web.

Cheers
Bruce