Subject | Re: [firebird-support] Understand FB transactions |
---|---|
Author | Ann Harrison |
Post date | 2013-03-10T18:15:17Z |
On Sun, Mar 10, 2013 at 1:15 PM, jacobhavkrog <jacobh@...> wrote:
so you can't, for example, create a table and store records in it in a
single transaction.
savepoints so you can back out part of a transaction, but you can't commit
part of a transaction before the whole transaction commits.
transactions, one for the first alter table, then one for the data and the
second alter table. Three transactions would be better - metadata, data,
then metadata.
Good luck,
Ann
> Hi - I'm using IBO as a replacement to BDE in my delphi application.Unfortunately, you can't. Firebird defers metadata changes to commit time,
>
> In converting my code I've come to a problem where I need to understand FB
> transactions better.
>
> In my code I need to update the metadata and data of an already running
> database on costumer sites. What I would like to happen, is that the
> entire update and is contained within one single transaction.
>
so you can't, for example, create a table and store records in it in a
single transaction.
>The concept of "nested transactions" is a little slippery. You can use
> No way of using nested transactions here?
>
savepoints so you can back out part of a transaction, but you can't commit
part of a transaction before the whole transaction commits.
>Unfortunately, you can't do that with Firebird. You'll need two separate
> My problem isn't exactly with the above code, but something similar that
> involves altering a table, adding some data to the table, and then again
> altering tables, adding constraints etc in the end. I hoped it would be
> possible to encapsulate it all in one transaction, so that if something
> goes wrong, I'll be able to do a ROLLBACK, and things will be as they were
> before.
>
transactions, one for the first alter table, then one for the data and the
second alter table. Three transactions would be better - metadata, data,
then metadata.
>Build a script or program that knows how to undo each of the steps.
> What the best way to handle this kind of thing?
>
Good luck,
Ann
>[Non-text portions of this message have been removed]
>
>
>