From: Ernest E Vogelsinger <ernest@vogelsinger.at>
To: scott.marlowe <scott.marlowe@ihs.com>
Cc: Raphael Bauduin <raphael.bauduin@be.easynet.net>
Cc: David Busby <busby@pnts.com>
Cc: pgsql-php@postgresql.org
Subject: Re: Number of connections
Date: Fri, 23 May 2003 19:05:52 +0200
Message-ID: <5.1.1.6.2.20030523190006.0318cca0@mail.vogelsinger.at> (raw)
In-Reply-To: <Pine.LNX.4.33.0305230937090.27073-100000@css120.ihs.com>
References: <20030518122859.GA25073@raphael>
At 17:45 23.05.2003, scott.marlowe said:
--------------------[snip]--------------------
>...
>The problem with keep alive is that apache has a short attention span,
>since the default timeout for keep alives is 15 seconds. Let's say user A
>opens a web page with a form, and edits it for 3 minutes. His keep alive
>connection is gone. While it is still very likely that his next request
>will be serviced by the same child as the last time, there is NOT
>guarantee.
--------------------[snip]--------------------
I've read in another thread (either here, or in php-general) that PHP
clears out any transactions that might be open when you pg_connect() or
ph_pconnect(), by issuing "begin;rollback;".
If this is the case this would mean you simply CANNOT have transactions
open across multiple requests.
Which is a good thing IMHO. Just think of the mess that would be created if
client A opens a transaction, client B (using the same child process,
pg_pconnect()ing to the same database) runs a totally different set of
instructions and commits the transaction. A's "transaction" would be
partially committed by B...
Transactions are designed to be atomic operations, and I strongly believe
they should be treated exactly this way - begin, do your stuff, commit or
rollback. In one request. Anyway, pending transactions may lock rows or
tables, and may keep other parts of an application from running at all.
Just my 2c worth...
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
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: ernest@vogelsinger.at, scott.marlowe@ihs.com, raphael.bauduin@be.easynet.net, busby@pnts.com
Subject: Re: Number of connections
In-Reply-To: <5.1.1.6.2.20030523190006.0318cca0@mail.vogelsinger.at>
References: <20030518122859.GA25073@raphael> <5.1.1.6.2.20030523190006.0318cca0@mail.vogelsinger.at>
* 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