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