Re: Pg + perl + apache - Mailing list pgsql-general

From Tom Lane
Subject Re: Pg + perl + apache
Date
Msg-id 10987.1076882888@sss.pgh.pa.us
Whole thread Raw
In response to Pg + perl + apache  ("Michael L. Artz" <dragon@october29.net>)
List pgsql-general
"Michael L. Artz" <dragon@october29.net> writes:
> Anway, DBD::Pg throws random errors into my logs, along the lines of
> what is below (the lines beginning with SQL are debug statements from
> the script, and are the lines references by the DBD error.

> LOG:  statement: SELECT session_key FROM session WHERE user_id = 101
> ERROR:  current transaction is aborted, queries ignored until end of
> transaction block

This error cannot occur unless some other error occurred previously in
the same transaction.

My bet is that you are using some sort of connection-pooling mechanism,
and are being sloppy about handing off database connections from one
Apache thread to another.  Specifically, some thread is getting an error
and then letting go of the connection without rolling back the failed
transaction on the database side.  The next guy who gets that connection
from the pool fails as above.

            regards, tom lane

pgsql-general by date:

Previous
From: Andrew Rawnsley
Date:
Subject: Re: PostgreSQL License
Next
From: Oleg Bartunov
Date:
Subject: Re: PostgreSQL License