Skip site navigation (1) Skip section navigation (2)

Re: Nested transactions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>,Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>,Barry Lind <blind(at)xythos(dot)com>, simon(at)2ndquadrant(dot)com,Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Nested transactions
Date: 2004-06-18 15:38:10
Message-ID: 20920.1087573090@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-jdbcpgsql-patches
Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl> writes:
> I don't think we should explicitly forbid it.  I think it should be
> forbidden to close the outermost transaction inside a function (else the
> function would not be able to terminate correctly), but for levels
> before that one it'd be OK.

More specifically, a function cannot close any xact that was open when
it was called.  It can only close xacts that it started (or
equivalently, roll back to savepoints that it established).  Otherwise
the behavior is nonsensical.  Rollback of an outer transaction would
mean making like the function call never even happened, so the function
certainly couldn't expect to keep control.

			regards, tom lane

In response to

pgsql-patches by date

Next:From: Tom LaneDate: 2004-06-18 16:32:52
Subject: Re: Nested transactions
Previous:From: Gavin SherryDate: 2004-06-18 07:02:58
Subject: Re: Tablespace patch review

pgsql-jdbc by date

Next:From: Kris JurkaDate: 2004-06-18 16:30:17
Subject: Re: JDK 1.5 beta2 and generics
Previous:From: Paul BalanoiuDate: 2004-06-18 15:33:53
Subject: Re: unsubscribe

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group