Re: Nested Transactions, Abort All

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>, Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>, Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz>, Zeugswetter Andreas SB SD <ZeugswetterA(at)spardat(dot)at>, Andreas Pflug <pgadmin(at)pse-consulting(dot)de>, Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Nested Transactions, Abort All
Date: 2004-07-09 20:18:43
Message-ID: 200407092018.i69KIkv04416@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Simon Riggs wrote:
> On Fri, 2004-07-09 at 20:34, Bruce Momjian wrote:
> > Alvaro Herrera wrote:
> > > On Fri, Jul 09, 2004 at 09:07:58PM +0200, Dennis Bjorklund wrote:
> > > > On Fri, 9 Jul 2004, Alvaro Herrera wrote:
> > > >
> > > > > Clearly savepoints do not allow for a snapshot to be released; nested
> > > > > xacts do.
> > > >
> > > > Why not?
> > >
> > > What is it?
> >
> > Simon posted it. It is called RELEASE:
> >
> > > BEGIN;
> > > SAVEPOINT x1;
> > > INSERT INTO ...;
> > > RELEASE SAVEPOINT x1;
> > > SAVEPOINT x1;
> > > INSERT INTO ...;
> > > RELEASE SAVEPOINT x1;
> > > SAVEPOINT x1;
> > > INSERT INTO ...;
> > > RELEASE SAVEPOINT x1;
>
> Yes, this is the DB2 and SQLAnywhere syntax.
>
> Oracle uses ROLLBACK TO SAVEPOINT...identical pretty much.

I thouht ROLLBACK was different from RELEASE, no? I see ROLLBACK used
in SQL99 for savepoints:

ROLLBACK [ WORK ] [ AND [ NO ] CHAIN ]
[ <savepoint clause> ]

RELEASE only discards the savepoint name, I thought.

> Oracle's support of autonomous transactions looks to be identical to
> nested transactions (Alvaro's advice required there...). They don't
> allow you to explicitly call them, but you can use BEGIN/COMMIT in a
> host program that calls a stored procedure, which also contains
> BEGIN/COMMIT, effectively giving nested txns.

Oracle has nested transactions too? Can you supply an example?

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2004-07-09 20:32:20 Re: Nested Transactions, Abort All
Previous Message Bruce Momjian 2004-07-09 20:07:19 Re: Nested Transactions, Abort All