Re: A transaction in transaction? Possible?
От | Peter Eisentraut |
---|---|
Тема | Re: A transaction in transaction? Possible? |
Дата | |
Msg-id | 200411101709.48968.peter_e@gmx.net обсуждение исходный текст |
Ответ на | Re: A transaction in transaction? Possible? (Achilleus Mantzios <achill@matrix.gatewaynet.com>) |
Список | 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 по дате отправления: