Re: [GENERAL] RE: postgresql and web transactions

From: "Manuel Lemos" <mlemos(at)acm(dot)org>
To: "Lincoln Yeoh" <lylyeoh(at)mecomb(dot)com>
Cc: pgsql-general(at)hub(dot)org
Subject: Re: [GENERAL] RE: postgresql and web transactions
Date: 2000-02-18 20:10:34
Message-ID: 1640.83T1703T10904732mlemos@acm.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello Lincoln,

On 18-Feb-00 05:40:51, you wrote:

>About transactions, I find that they're not that useful in a typical web
>app, because
>1) Many web apps are simple, and don't need transactions, or have simple
>work arounds.

You mean that applications that require almost read only databases, or
single table updates do not require transactions. You can't live without
transactions outside that scenario unless you want to risk your
applications to break due to database inconsistencies when many users are
working with the application.

>2) And when you do need transactions, HTTP is not very state friendly, so
>unless you do something special your database level transaction is
>typically going to last only one page, so if your real life transaction
>spans across multiple pages, the database level transaction system isn't
>going to help much.

The way I see it transactions are meant to turn a set of queries virtually
atomic. Anyway, transaction queries should be done one after the other.
You should not leave a transaction open for an unrestricted period of time.

If you need to hold locks on data for an unknown amount of time, you'd
better find other solutions besides transactions. For instance if you
want to hold on a ticket reservation for a client before he decides to
purchase it, you should not use transactions to lock the reservation.

Regards,
Manuel Lemos

Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/?user=mlemos(at)acm(dot)org
--
E-mail: mlemos(at)acm(dot)org
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
--

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Shrewsbury 2000-02-18 20:52:06 ORDER BY problems
Previous Message Gary Horton 2000-02-18 19:13:15 pg general newbie