Subject RE: [firebird-support] UDF Unloaded
Author Alan McDonald
> Hi,
> I wanted to know when are UDF's unloaded? I'm doing something "risky"
> where I have a internal variable counter in the udf and I noticed the
> UDF is unloaded when the user disconnects, but I wanted to know what
> if I had a UDF function that is doing something that isn't completed
> yet when the user disconnects?
> Thanks

Since the server is threaded, UDF's are also loaded in a threaded
environment - there's not much chance of this "internal variable" giving you
a reliable result in your wildest dreams.
They unload when disconnect occurs because they are database related, not
server related.
Also remember that UDFs can't just go off doing there own thing and taking
there own time. The server expects them to respond almost immediately.
You'll be locking up the server from executing futher steps until the UDF
returns it's result.