Re: Apache::DBI and DBD::Pg - Mailing list pgsql-general

From Tim Bunce
Subject Re: Apache::DBI and DBD::Pg
Date
Msg-id 20060115093831.GA1196@timac.local
Whole thread Raw
In response to Re: Apache::DBI and DBD::Pg  (Jeremy Nixon <jeremy@exit109.com>)
List pgsql-general
On Sun, Jan 15, 2006 at 02:00:15AM +0000, Jeremy Nixon wrote:
> Tyler MacDonald  <tyler@yi.org> wrote:
>
> > [Fri Jan 13 23:46:28 2006] [error] [client 192.168.99.112] DBD::Pg::db
> > prepare_cached failed: FATAL: terminating connection due to administrator
>
> Here's the thing: if your database connection goes away, and Apache::DBI
> opens a new one, any prepared statement handles you might have become
> invalid, because prepared statements are per-connection.
>
> My way around it is to not use prepared statements.

Another, better, way is to use prepare_cached() along with connect_cached().

http://search.cpan.org/src/TIMB/DBI_AdvancedTalk_2004/sld029.htm and later slides.

Tim.


pgsql-general by date:

Previous
From: Jeremy Nixon
Date:
Subject: Re: Apache::DBI and DBD::Pg
Next
From: Zlatko Matić
Date:
Subject: visual query builder for Postgres?