Re: Nested transaction workaround?

From: "Chris Travers" <chris(at)travelamericas(dot)com>
To: <johnsw(at)wardbrook(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Nested transaction workaround?
Date: 2004-01-14 07:45:38
Message-ID: 011c01c3da76$ac8af5d0$dd44053d@winxp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I was thinking about the nested transaction problem, and I came across an
interesting insight. While it is true you could use dblink to perform db
operations outside the transaction (which could be useful for logging, etc.)
what is lacking is a way to roll back the internal transactions when the
parent rolls back.

It also occured to me that the main problem with nested transactions is that
the hard part is this inherited rollback/commit, esp. with MVCC which places
constraints on how one could look at managing these commit/rollbacks without
paying huge performance costs even where, as in the majority of cases, this
feature is not used. I am assuming that part of the problem is how the
visibility/transaction information is handled via MVCC. Is my understanding
correct?

My final, albeit half-baked, conclusion is that one of the things that would
make nested transactions MUCH easier would be a two-phase commit (2PC)
framework which would be stored on the transaction level. Something like a
transaction status storage which contains the following information: Status
(in progress, committed, rolled back, pending commit as in 2PC), and
"depends on xid" where you can then have the pending commit become
'committed' when transaction xid is commited. Again this is just off the
top of my head.

Also an 2PC framework if added into the protocol would allow for true nested
transactions via DBLink.

Best Wishes,
Chris Travers

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrei Ivanov 2004-01-14 08:02:31 Re: dump/restore problem
Previous Message Martijn van Oosterhout 2004-01-14 05:51:05 Re: Optimising SQL Queries?