X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id BFFFC30DF23 for ; Tue, 10 Jun 2003 13:43:31 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 89376-09 for ; Tue, 10 Jun 2003 10:43:21 -0300 (ADT) Received: from jive.SoftHome.net (jive.SoftHome.net [66.54.152.27]) by svr1.postgresql.org (Postfix) with SMTP id 5D97730EB1E for ; Tue, 10 Jun 2003 10:43:20 -0300 (ADT) Received: (qmail 29148 invoked by uid 417); 10 Jun 2003 13:43:21 -0000 Received: from shunt-smtp-out-0 (HELO softhome.net) (172.16.3.12) by shunt-smtp-out-0 with SMTP; 10 Jun 2003 13:43:21 -0000 Received: from clairvo ([217.217.107.146]) (AUTH: LOGIN adriantineo@softhome.net) by softhome.net with esmtp; Tue, 10 Jun 2003 07:43:15 -0600 Message-ID: <003701c32f56$3b8b8c80$926bd9d9@clairvo> From: "Adrian Tineo" To: "Greg Spiegelberg" , pgsql-php@postgresql.org References: <1055245742.56597.30.camel@jester> <3EE5C364.4050008@cranel.com> Subject: Re: Cleaning up aborted transactions Date: Tue, 10 Jun 2003 15:42:38 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Archive-Number: 200306/9 X-Sequence-Number: 2073 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