Re: PHP, PostgreSQL and transactions - Mailing list pgsql-general

From lbayuk@mindspring.com (ljb)
Subject Re: PHP, PostgreSQL and transactions
Date
Msg-id 9h0mo7$1er0$1@news.tht.net
Whole thread Raw
List pgsql-general
nils@mbit.nl wrote:
>Hi all,
>
>I want to make use of PostgreSQL's ability of transactions in a PHP
>application. What happens when a transaction spreads over more than one
>page and a user doesn't continue the transaction?

You can't do it. Read the part in the PHP manual about what persistent
(pooled) connections really are, and what they aren't. They aren't a way
to continue a connection across mutliple page requests. For one thing,
a different web server child process is likely to handle each request.
If you are using persistent connections from PHP to PostgreSQL, you
really must make absolutely sure all transactions are closed at the
end of the page. You can use register_shutdown_function to do this.

pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: postgres 7.1.2 with SuSE 7.1
Next
From: Ana Carolina Alonso de Armiño
Date:
Subject: Re: postgres 7.1.2 with SuSE 7.1