Subject | Re: COMMIT and ROLLBACK in SP |
---|---|
Author | Adam |
Post date | 2005-06-16T09:39:01Z |
--- In firebird-support@yahoogroups.com, <buppcpp@y...> wrote:
A SP is just like a query. It must be run from within a transaction.
It is not the query that gets committed or rolled back, but rather the
transaction that the query "belongs to".
Think about transactions as being the context by which you understand
the query. The query does not control the start or end of the transaction.
Whether "save points" become supported in PSQL in the future is
probably a point for consideration, but it would go against the whole
architecture of transactions to allow SPs to commit or rollback the
transaction. Note that you probably don't even need save points in SP
if your exception handling is done correctly.
Adam
> OK, so technically, there is no reason why commit/rollbacks are notNo,
> supported in SP, it's just a decision that was made not to allow it?
>
> Correct?
A SP is just like a query. It must be run from within a transaction.
It is not the query that gets committed or rolled back, but rather the
transaction that the query "belongs to".
Think about transactions as being the context by which you understand
the query. The query does not control the start or end of the transaction.
Whether "save points" become supported in PSQL in the future is
probably a point for consideration, but it would go against the whole
architecture of transactions to allow SPs to commit or rollback the
transaction. Note that you probably don't even need save points in SP
if your exception handling is done correctly.
Adam
> >