Re: using CURSOR with PHP

Поиск
Список
Период
Сортировка
От Marco Colombo
Тема Re: using CURSOR with PHP
Дата
Msg-id Pine.LNX.4.44.0205291420120.24472-100000@Megathlon.ESI
обсуждение исходный текст
Ответ на Re: using CURSOR with PHP  (Keary Suska <hierophant@pcisys.net>)
Список pgsql-php
On Tue, 28 May 2002, Keary Suska wrote:

> on 5/28/02 10:26 AM, marco@esi.it purportedly said:
>
> > Well, with HTTP keepalive, it may even keep the HTTP session open.
> > But the problem is that you can't relay on it.
> > Moreover, I suspect that PHP resets the SQL session when it performs
> > an pconnect (that means, it asks the SQL backend to abort uncommitted
> > transactions, drop TEMP relations, and so on).
>
> Actually, no. According to the docs:
>
> "Warning
> There are a couple of additional caveats to keep in mind when using
> persistent connections. One is that when using table locking on a persistent
> connection, if the script for whatever reason cannot release the lock, then
> subsequent scripts using the same connection will block indefinitely and may
> require that you either restart the httpd server or the database server.
> Another is that when using transactions, a transaction block will also carry
> over to the next script which uses that connection if script execution ends
> before the transaction block does. In either case, you can use
> register_shutdown_function() to register a simple cleanup function to unlock
> your tables or roll back your transactions. Better yet, avoid the problem
> entirely by not using persistent connections in scripts which use table
> locks or transactions (you can still use them elsewhere)."

Looks like that paragraph is missing from my local copy of the manual:
time to update it. B-)

Anyway, if PHP isn't able to reset the existing connection to an initial
state (just like a new one), it's a bug. Scripts shouldn't relay on
that (mis)behaviour, IMHO.

> I had heard that this auto-cleanup functionality was supposed to be added,
> and there is a directive "pgsql.auto_reset_persistent" that is undocumented,
> that perhaps implements this, but it may be considered experimental. Unless
> the docs aren't properly up to date, which is not uncommon.
>
>
> Keary Suska
> Esoteritech, Inc.
> "Leveraging Open Source for a better Internet"
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>

.TM.
--
      ____/  ____/   /
     /      /       /            Marco Colombo
    ___/  ___  /   /              Technical Manager
   /          /   /             ESI s.r.l.
 _____/ _____/  _/               Colombo@ESI.it


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

Предыдущее
От: Andrew McMillan
Дата:
Сообщение: Re: using CURSOR with PHP
Следующее
От: "Jules Alberts"
Дата:
Сообщение: variable visibility when using