Subject Re: [firebird-support] Stored Procedure Scope
Author Doug Chamberlin
At 10/21/2005 04:09 PM (Friday), Jason Dodson wrote:

>Just a quick question... or more, a confirmation of what I do/don't know...
>
>Does what happen in a stored procedure belong to the transaction it was called
>in, or is it immediately applied, and seperate?
>
>Jason

In Firebird, stored procedures execute within the context of a database
transaction. They cannot start or end a transaction themselves. The
transaction must be started by the client before the stored procedure is
executed.

Most client middleware offers a way to automatically start and commit
transactions so you don't have to be bothered with them. Most client
middleware also offers a way to explicitly control transactions (which is
strongly preferred by the more experienced among us).

Generators, however, operate outside of transaction context so the effect
of generator operations, whether within a stored procedure or not, will
remain regardless of transaction outcomes.