Re: Nested Transactions, Abort All

Поиск
Список
Период
Сортировка
От Dennis Bjorklund
Тема Re: Nested Transactions, Abort All
Дата
Msg-id Pine.LNX.4.44.0407092240060.2838-100000@zigo.dhs.org
обсуждение исходный текст
Ответ на Re: Nested Transactions, Abort All  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Список pgsql-hackers
On Fri, 9 Jul 2004, Alvaro Herrera wrote:

> > Simon posted it.  It is called RELEASE:
> 
> We can't actually release anything (commit the subtransactions), because
> they may be savepoints established after that point, and they are
> logically "inside" the previously established ones.  At RELEASE we can't
> really release -- we just lose the name and thus the opportunity to
> rollback to it.

You can still perform the release. If we have
 SAVEPOINT p1;
 SAVEPOINT p2;
 RELEASE p2;

then it's no problem, we released the topmost savepoint (commit the
corresponding subtransaction). And if we have
 SAVEPOINT p1;
 SAVEPOINT p2;
 RELEASE p1;

now you are saying that we just forget the name p1 and the subtransaction
for p1 is still there for ever.

But one should also link the subtransaction for p1 to p2, so when p2 is
released then also the (now unnamed) subtransaction for p1 is commited. Of
course we can't release p1 as long as p2 is still active. p2 is logically
a subtransaction of p1.

One don't really need an explicit link. When p2 is released all one needs 
to do is to look at the parent and see if that is still named, if not it 
should be commited and so on until we reach a named one.

-- 
/Dennis Björklund



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Nested Transactions, Abort All
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Nested Transactions, Abort All