Re: A transaction in transaction? Possible? - Mailing list pgsql-sql

From Peter Eisentraut
Subject Re: A transaction in transaction? Possible?
Date
Msg-id 200411101709.48968.peter_e@gmx.net
Whole thread Raw
In response to Re: A transaction in transaction? Possible?  (Achilleus Mantzios <achill@matrix.gatewaynet.com>)
List 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/



pgsql-sql by date:

Previous
From: Achilleus Mantzios
Date:
Subject: Re: A transaction in transaction? Possible?
Next
From: "Goutam Paruchuri"
Date:
Subject: Error In connection ??