Subject Re: In a Firebird UDF, can you establish a connection back to the database?
Author Ann
--- In firebird-support@yahoogroups.com, "Steve" <steve_goa@...> wrote:
>
> Sub: In a Firebird UDF, can you establish a connection back to the
> database?
>

Yes, but you establish an entirely new connection, so you're
queries are not part of the same transaction as the thread
that invoked the UDF. You won't see changes made by the UDF
in your transactions. Nor will you see changes you made
from the UDF. Generally, that's reason enough not to try
to circle back from a UDF. The fact that your transaction
can deadlock against the UDF transaction adds to the disincentive.

A better architecture, generally, is to invert whatever you're
doing so a procedure drives the UDF rather than trying to invoke
a procedure from a UDF.


Good luck,

Ann