Re: PREPARE TRANSACTION and webapps

From: Kris Jurka <books(at)ejurka(dot)com>
To: Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)my>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: PREPARE TRANSACTION and webapps
Date: 2005-11-15 20:06:42
Message-ID: Pine.BSO.4.61.0511151438130.15136@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Kris Jurka 2005-11-15 20:09:32 Re: lo_import()
Previous Message Joshua D. Drake 2005-11-15 20:06:20 Re: 3 x PostgreSQL in cluster/redunant