Re: persistent vs. non-persistent

Поиск
Список
Период
Сортировка
От Brent R. Matzelle
Тема Re: persistent vs. non-persistent
Дата
Msg-id 20011002160633.57751.qmail@web13007.mail.yahoo.com
обсуждение исходный текст
Ответ на Re: persistent vs. non-persistent  ("Chris Ruprecht" <chrup999@yahoo.com>)
Список pgsql-php
--- Chris Ruprecht <chrup999@yahoo.com> wrote:
> Brent,
>
> given, that you keep the connection open indefinitely, how do
> you use it?
>
> Do I go and $db = pg_pconnect(...); when I first start apache
> and then never
> do a connect again, unless I re-start apache?

Not quite.  When you run pg_pconnect() apache automatically
opens a PG connection and holds on to it until it dies or apache
is restarted.  However, in order to use that database connection
again, for each PHP page you will need to re-run pg_pconnect().
Then apache will look for any httpd processes that have an
identical open PG connection.  If there is one then it will use
that connection instead of creating a new one, thus saving you
the connection overhead.

You can read more about it here:
http://www.php.net/manual/en/features.persistent-connections.php

Brent

__________________________________________________
Do You Yahoo!?
Listen to your Yahoo! Mail messages from any phone.
http://phone.yahoo.com

В списке pgsql-php по дате отправления:

Предыдущее
От: "Chris Ruprecht"
Дата:
Сообщение: Re: persistent vs. non-persistent
Следующее
От: Andrew McMillan
Дата:
Сообщение: Re: persistent vs. non-persistent