pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Frank Finner <postgresql@finner.de>
To: zedaardv@drizzle.com
Cc: pgsql-php@postgresql.org
Subject: Re: [0.2] getting transactions to work
Date: Fri, 30 Jul 2004 21:54:36 +0200
Message-ID: <20040730215436.188139a4.postgresql@finner.de> (raw)
In-Reply-To: <410A61EB.6070008@23net.net>
References: <27ABA345-E238-11D8-8EE0-000A95984CA6@drizzle.com>
	<410A61EB.6070008@23net.net>

You could have a transaction span multiple pages (not scripts), if you keep the
script in memory and use different parts of it with different templates for
different pages. This is possible using FastCGI (http://www.fastcgi.com). I
do this with Perl, occasionally with C, but I did not have spare time to try it
with PHP, although it should work, if you use PHP like a FastCGI CGI script, and
not a one-script-per-page technique.

Of course there are some drawbacks like necessity to always initialise
variables very carefully, possibility of noticeable memory leaks and strange
cacheing effects. In fact with FastCGI you create a persistent server
application connected to your webserver, not just a volatile script.

Regards, Frank.


On Fri, 30 Jul 2004 10:57:47 -0400 Rod K <rod@23net.net> sat down, thought long
and then wrote:

> You are correct.  You cannot have a transaction span multiple pages/scripts.
> 
> reiner peterke wrote:
> 
> > there seems to be very little info around on actually using 
> > transactions with postgres.  i've tried to create a page that will 
> > take input from a form and insert it into my database.  it works if i 
> > just do it without transactions but when i try to use with the begin 
> > and commit sections of code, it doesn't update the data base.  i'm 
> > guessing it is doing a rollback when my page loads itself again.  can 
> > anyone help me out here ?
> >
> > thanks
> >


-- 
Frank Finner

Invenius - Solutions in Linux
Köpfchenstraße 36
57072 Siegen
Telefon: 0271 231 8606    Mail: frank.finner@invenius.org
Telefax: 0271 231 8608    Web:  http://www.invenius.org
Key fingerprint = 6A60 FA85 F670 4FC3 CD7C  CED5 4F4C 72B1 54AC 165E


view thread (18+ messages)  latest in thread

Message-ID: <20040730215436.188139a4.postgresql@finner.de>
Permalink:  ../20040730215436.188139a4.postgresql@finner.de/
Also on:    postgresql.org/message-id/20040730215436.188139a4.postgresql@finner.de

 · 

reply

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: postgresql@finner.de, zedaardv@drizzle.com
  Subject: Re: [0.2] getting transactions to work
  In-Reply-To: <20040730215436.188139a4.postgresql@finner.de>
  References: <27ABA345-E238-11D8-8EE0-000A95984CA6@drizzle.com> <410A61EB.6070008@23net.net> <20040730215436.188139a4.postgresql@finner.de>

* 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