Re: PREPARE TRANSACTION and webapps - Mailing list pgsql-general

From Kris Jurka
Subject Re: PREPARE TRANSACTION and webapps
Date
Msg-id Pine.BSO.4.61.0511151438130.15136@leary.csoft.net
Whole thread Raw
In response to Re: PREPARE TRANSACTION and webapps  (Lincoln Yeoh <lyeoh@pop.jaring.my>)
List pgsql-general

On Tue, 15 Nov 2005, Lincoln Yeoh wrote:

> Can we have a reconnect and "reopen prepared/saved transactions" feature?
>
> Please? :)
>

Note that this (transaction suspend/resume) is also required for a full
implementation of XA.  Our current 2PC only supports the basics.  There's
a bunch of other complicated features, like transaction interleaving[1]
and multiple threads of control participating in the same backend
transaction[2] that we currently don't support either.  Now some of these
may be worked around and faked on the driver side, but it won't be able to
do these well.  For example you could implement suspend/resume by simply
holding the backend connection open or you could implement interleaved
transactions by opening multiple connections, but both have a serious cost
in the number of open connections.  It would be better to implement this
functionality in the backend, but I'm not sure how important these
situations are in the real world.  Some on the jdbc list have shown ways
to configure transaction managers to avoid using these exotic features.

Also I think that trying to use 2PC without a real transaction manager is
just asking for trouble.  Normal XA usage is two serverside resources held
open the time it takes to service a single request, not wait for user
input.  A random webapp leaving suspended or prepared transactions around
is going to lock things up in a hurry.

Kris Jurka

[1] http://archives.postgresql.org/pgsql-jdbc/2005-06/msg00165.php
[2] http://archives.postgresql.org/pgsql-jdbc/2005-06/msg00171.php

pgsql-general by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: ablilty to test record for foreign key before deleting the record?
Next
From: "Joshua D. Drake"
Date:
Subject: Re: 3 x PostgreSQL in cluster/redunant