Subject Re: In a Firebird UDF, can you establish a connection back to the database?
Author Steve
--- In firebird-support@yahoogroups.com, "Ann" <aharrison@...> wrote:
>
>
>
> --- 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
>


Thank you for replying, Ann. However, I want to establish whether this is possible or not - and not whether it is recommended or not.

Thanks anyway,

Steve