Subject | Re: Inserting 100's of thousands from a SP |
---|---|
Author | Adam |
Post date | 2005-07-10T11:50:44Z |
Hi Bupp,
I think you are misunderstanding savepoints
They are simply an extension to the rollback, that allows you to "undo
back to a point" rather than "undo everything in this transaction".
For example, my client program may run a series of queries and stored
procedures to achieve its task. At some point, an exception may be
raised, and my client program then wants to undo the last few queries
and take another action. In other words I don't want to undo every
query, just back to a point, and I can then carry on.
Savepoints are available in FB 1.5, however they do not commit
transactions. Think of them like a bookmark that later you can revert to.
But you need to understand that a stored procedure is just like a
query. It runs in the context of a transaction, but it itself does not
start or finish a transaction.
Further, you actually can't declare savepoints within a SP as this is
not supported. It would be unneccessary in any case because you can
handle the execution flow using exceptions and the when ??? do syntax.
Transactions can only be managed (started and committed or rolled
back) by a client application.
Adam
I think you are misunderstanding savepoints
They are simply an extension to the rollback, that allows you to "undo
back to a point" rather than "undo everything in this transaction".
For example, my client program may run a series of queries and stored
procedures to achieve its task. At some point, an exception may be
raised, and my client program then wants to undo the last few queries
and take another action. In other words I don't want to undo every
query, just back to a point, and I can then carry on.
Savepoints are available in FB 1.5, however they do not commit
transactions. Think of them like a bookmark that later you can revert to.
But you need to understand that a stored procedure is just like a
query. It runs in the context of a transaction, but it itself does not
start or finish a transaction.
Further, you actually can't declare savepoints within a SP as this is
not supported. It would be unneccessary in any case because you can
handle the execution flow using exceptions and the when ??? do syntax.
Transactions can only be managed (started and committed or rolled
back) by a client application.
Adam