Re: incomplete transaction keeps table locked?

From: "Richard Huxton" <dev(at)archonet(dot)com>
To: "George Herson" <gherson(at)snet(dot)net>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: incomplete transaction keeps table locked?
Date: 2001-05-23 08:52:15
Message-ID: 004401c0e365$aba39380$1001a8c0@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

From: "George Herson" <gherson(at)snet(dot)net>

> Hi. I'm running PostgreSQL 7.0.2 on Linux 2.2.14, i686.
>
> Are there any circumstances when exiting a PHP web script
> where you've started a transaction (with Begin Work) but haven't
explicitly
> done a Commit Work or Rollback before it ends will lock you out of
> a table (until you restart postgresql)? I wouldn't do this normally but i
> was commenting out different portions of the PHP script in question to
isolate
> a bug in my code. Does Postgres somehow get notified when a PHP script
ends
> so it knows to end a transaction in progress? If not, how can i ensure a
> clean slate before attempting more sql commands in the next running of a
PHP
> script?

You using persistent connections? If so, Apache+PHP will keep connections
hanging around and PG doesn't know your session is finished. See mail
archives for details and the latest 4.0.x release (4/5?) changelog for
details.

If you're not using persistent connections you've got problems since PHP
should be clearing down the connection at the end of each request.

- Richard Huxton

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message hicham bouzdad 2001-05-23 09:59:40 transactions on Postgresql
Previous Message Richard Huxton 2001-05-23 08:49:27 Re: can't start as root