From: Adrian Tineo <adriantineo@softhome.net>
To: Greg Spiegelberg <gspiegelberg@cranel.com>
To: pgsql-php@postgresql.org
Subject: Re: Cleaning up aborted transactions
Date: Tue, 10 Jun 2003 15:42:38 +0200
Message-ID: <003701c32f56$3b8b8c80$926bd9d9@clairvo> (raw)
References: <1055245742.56597.30.camel@jester>
<3EE5C364.4050008@cranel.com>
Hi Greg
> Just so I have this straight, because I've been wondering the same,
> if someone on my web site does a SELECT and then clicks on the browser
> stop or gets click happy hitting one or many other links on the same
> web page then the 1st SELECT and all other interrupted SELECT's should
> get rolled back if each query starts with a BEGIN; because there is a
> disconnect. Correct?
I don't let that happen. First, I gather all the required information, then
when the user clicks on submit or whatever he's doing, I do all in one
transaction. If it ends right the user is taken to a screen where he knows
that everything went fine (commit was successfull). If it fails at some
point I send the user to an error page, which can be more or less
descriptive depending on the needs of the interface.
> What about with persistant connections?
I haven't used them as most server out there will have them disabled.
Besides I don't think you need them and is probably not very efficient, also
it could limit the number of users for your app. And it can lead to
unpredictable behaviour on complex websites. If you don't need them, avoid
them.
Adrian Tineo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-php@postgresql.org
Cc: adriantineo@softhome.net, gspiegelberg@cranel.com
Subject: Re: Cleaning up aborted transactions
In-Reply-To: <003701c32f56$3b8b8c80$926bd9d9@clairvo>
References: <1055245742.56597.30.camel@jester> <3EE5C364.4050008@cranel.com> <003701c32f56$3b8b8c80$926bd9d9@clairvo>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox