Re: Named transaction

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Pavel Golub <pavel(at)gf(dot)microolap(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Named transaction
Date: 2009-06-17 19:51:02
Message-ID: 4A394926.4090308@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>
>> Alvaro Herrera wrote:
>>
>>> AFAIK that's an "autonomous transaction", at least to some other RDBMSs.
>>>
>
>
>> Right, but since I had to ask what that was recently I though I'd use a
>> bit more description :-)
>>
>
> Yes, but some other followups suggest that maybe a "named transaction"
> does something else entirely. Thus my request for a definition of what
> the OP is actually asking for.
>

According to the (hard to find) Firebird docs (or rather, the old
Interbase docs, which is all they have):

A single application can start simultaneous transactions. InterBase
extends transaction
management and data manipulation statements to support transaction
names, unique
identifiers that specify which transaction controls a given
statement among those
transactions that are active.

Transaction names must be used to distinguish one transaction from
another in programs
that use two or more transactions at a time. Each transaction
started while other
transactions are active requires a unique name and its own SET
TRANSACTION statement.
SET TRANSACTION can include optional parameters that modify a
transaction’s behavior.

There are four steps for using transaction names in a program:
1. Declare a unique host-language variable for each transaction
name. In C and
C++, transaction names should be declared as long pointers.
2. Initialize each transaction name to zero.
3. Use SET TRANSACTION to start each transaction using an available
transaction
name.
4. Include the transaction name in subsequent transaction management and
data manipulation statements that should be controlled by a specified
transaction.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Sabino Mullane 2009-06-17 20:22:51 Cannot use all four trigger events at once
Previous Message Joshua D. Drake 2009-06-17 19:43:09 Re: Named transaction