Threads considerations

A UDF, defined as FENCED, runs in the same job as the SQL statement that called it. However, the UDF runs in a system thread, separate from the thread that is running the SQL statement.

Because the UDF runs in the same job as the SQL statement, it shares much of the same environment as the SQL statement. However, because it runs under a separate thread, the following threads considerations apply:

Related reference
Fenced or unfenced considerations
Related information
Database considerations for multithreaded programming