Re: Autonomous Transaction (WIP)
От | Hannu Krosing |
---|---|
Тема | Re: Autonomous Transaction (WIP) |
Дата | |
Msg-id | 5344EEDF.4090701@krosing.net обсуждение исходный текст |
Ответ на | Re: Autonomous Transaction (WIP) (Pavan Deolasee <pavan.deolasee@gmail.com>) |
Ответы |
Re: Autonomous Transaction (WIP)
|
Список | pgsql-hackers |
On 04/09/2014 08:44 AM, Pavan Deolasee wrote:
I would hope most of this to be solved by having one (read only) virtual transaction andOn Wed, Apr 9, 2014 at 11:03 AM, Rajeev rastogi <rajeev.rastogi@huawei.com> wrote:Though autonomous transaction uses mixed approach of sub-transaction as well as main
transaction, transaction state of autonomous transaction is handled independently.Whenever I was asked to have a look at implementing this feature, I always wondered about the great amount of global state that a backend maintains which is normally tied to a single top transaction. Since AT will have same characteristics as a top level transaction, I wonder how do you plan to separate those global state variables ? Sure, we can group them in a structure and put them on a stack when an AT starts and pop them off when the original top transaction becomes active again, finding all such global state variables is going to be tricky.
then juggling the ATs in a way similar to current subtransaction machinery.
The main differences would be that:
A) the top level transaction stays virtual
and
B) ATs are committed independantly
This would be greatly simplified if we can accept the restriction that there is only single
snapshot per backend (not per transaction). To me this seems a completely sensible restriction.
Re syntax, I think we need a way to name the transactions so we can have a way
to switch between multiple parallel active autonomous transactions.
-----
BEGIN TRANSACTION myfirsttransaction;
do something in myfirsttransaction;
BEGIN TRANSACTION anothertransaction;
do something in anothertransaction;
SET TRANSACTION myfirsttransaction;
more work in myfirsttransaction;
ROLLBACK anothertransaction;
COMMIT; -- or COMMIT myfirsttransaction;
----
Cheers
Hannu
В списке pgsql-hackers по дате отправления: