Re: A transaction in transaction? Possible?

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: A transaction in transaction? Possible?
Date: 2004-11-10 16:09:48
Message-ID: 200411101709.48968.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Achilleus Mantzios wrote:
> In other words, now with savepoints, BEGIN; COMMIT; ROLLBACK;
> can be replaced with
> SAVEPOINT foo; RELEASE foo; ROLLBACK TO foo; respectively.
>
> If only transactions weren't a requirement for SAVEPOINTs,
> what would we then need BEGIN; COMMIT; ROLLBACK; for?

Note that under the current arrangement, it doesn't make much sense to
"commit" a subtransaction. It will be committed anyway when the main
transactions commits, and you cannot commit it earlier because the main
transaction could still roll back. So savepoint blocks are not really
transactions, but more like semi-transactions.

In other nested transaction models, things can be different. If you
have so-called open nested transactions, which expose their results to
other transactions already before the parent transaction commits, then
a subtransaction commit is useful. But that behavior violates the
isolation criterion of transactions and therefore needs additional
facilities to behave tolerably.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Goutam Paruchuri 2004-11-10 16:32:24 Error In connection ??
Previous Message Achilleus Mantzios 2004-11-10 16:01:36 Re: A transaction in transaction? Possible?