pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Keary Suska <hierophant@pcisys.net>
To: Postgres-PHP <pgsql-php@postgresql.org>
Subject: Re: using CURSOR with PHP
Date: Tue, 28 May 2002 13:53:09 -0600
Message-ID: <B9193C45.EE44%hierophant@pcisys.net> (raw)
In-Reply-To: <Pine.LNX.4.44.0205281818130.24472-100000@Megathlon.ESI>

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)."

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"




view thread (23+ messages)  latest in thread

Message-ID: <B9193C45.EE44%hierophant@pcisys.net>
Permalink:  ../B9193C45.EE44%25hierophant@pcisys.net/
Also on:    postgresql.org/message-id/B9193C45.EE44%hierophant@pcisys.net

 · 

reply

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: hierophant@pcisys.net
  Subject: Re: using CURSOR with PHP
  In-Reply-To: <B9193C45.EE44%hierophant@pcisys.net>
  References: <Pine.LNX.4.44.0205281818130.24472-100000@Megathlon.ESI> <B9193C45.EE44%hierophant@pcisys.net>

* 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