Subject | Re: In a Firebird UDF, can you establish a connection back to the database? |
---|---|
Author | Ann |
Post date | 2010-12-30T19:39:51Z |
--- In firebird-support@yahoogroups.com, "Steve" <steve_goa@...> wrote:
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
>Yes, but you establish an entirely new connection, so you're
> Sub: In a Firebird UDF, can you establish a connection back to the
> database?
>
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