Subject | Re: In a Firebird UDF, can you establish a connection back to the database? |
---|---|
Author | Steve |
Post date | 2010-12-30T20:50:20Z |
--- In firebird-support@yahoogroups.com, "Ann" <aharrison@...> wrote:
Thanks anyway,
Steve
>Thank you for replying, Ann. However, I want to establish whether this is possible or not - and not whether it is recommended or not.
>
>
> --- 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
>
Thanks anyway,
Steve