Re: Cleaning up aborted transactions

From: "Adrian Tineo" <adriantineo(at)softhome(dot)net>
To: "Greg Spiegelberg" <gspiegelberg(at)cranel(dot)com>, pgsql-php(at)postgresql(dot)org
Subject: Re: Cleaning up aborted transactions
Date: 2003-06-10 13:42:38
Message-ID: 003701c32f56$3b8b8c80$926bd9d9@clairvo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

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

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Kurt 2003-06-10 22:27:05 Groups
Previous Message Rod Taylor 2003-06-10 13:19:22 Re: Cleaning up aborted transactions