pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Mount <peter@retep.org.uk>
To: Bruce Momjian <pgman@candle.pha.pa.us>
To: Thies C. Arntzen <thies@digicol.de>
Cc: pgsql-jdbc@postgresql.org, PostgreSQL-interfaces <pgsql-interfaces@postgresql.org>
Subject: Re: PostgreSQL and PHP persistent connections
Date: Wed, 07 Feb 2001 21:41:43 +0000
Message-ID: <5.0.2.1.0.20010207214024.009ee160@mail.retep.org.uk> (raw)
In-Reply-To: <200102071912.OAA27530@candle.pha.pa.us>

At 14:12 07/02/01 -0500, Bruce Momjian wrote:
>Thies, we talked at LinuxWorld about improving the reliability of
>persistent PostgreSQL connections in PHP.
>
>I believe the problem is that persistent connections sometime do not
>pass clean sessions because of open transactions and SET changes to the
>session.
>
>We discussed using 'ROLLBACK' before passing a connection to a new user,
>but the problem was that ROLLBACK with no open transaction causes a
>server log error message.  We discussed adding 'ROLLBACK SILENT' to fix
>this, but I believe a better, more portable solution is a simple "BEGIN
>WORK;ROLLBACK".  This will do nothing if there is no open transaction,
>and will ROLLBACK any open transaction.  I propose this be sent by PHP
>as the first query when passing persistent connections.
>
>As far as SET changes, does anyone on the PostgreSQL interfaces list
>have a suggestion on how to RESET all session parameters?  Seems we may
>need to add this feature in to the backend.

Some Java apps utilise connection pools so they would possibly benefit. I 
could add the BEGIN WORK;ROLLBACK; to JDBC.

Peter




view thread (17+ messages)  latest in thread

Message-ID: <5.0.2.1.0.20010207214024.009ee160@mail.retep.org.uk>
Permalink:  ../5.0.2.1.0.20010207214024.009ee160@mail.retep.org.uk/
Also on:    postgresql.org/message-id/5.0.2.1.0.20010207214024.009ee160@mail.retep.org.uk

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: peter@retep.org.uk, pgman@candle.pha.pa.us, thies@digicol.de
  Subject: Re: PostgreSQL and PHP persistent connections
  In-Reply-To: <5.0.2.1.0.20010207214024.009ee160@mail.retep.org.uk>

* 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