Re: Prepared Statements vs. pgbouncer - Mailing list pgsql-jdbc

From Till Toenges
Subject Re: Prepared Statements vs. pgbouncer
Date
Msg-id 470125E2.9060505@kyon.de
Whole thread Raw
In response to Re: Prepared Statements vs. pgbouncer  (Paul Lindner <lindner@inuus.com>)
Responses Re: Prepared Statements vs. pgbouncer  (Paul Lindner <lindner@inuus.com>)
List pgsql-jdbc
Paul Lindner wrote:
> 1) Use hashing to choose a prepared statement name
>
>    If we take the hash of the prepared statement text and prefix with
>    S_ we can be assured of using the same unique prepared statement
>    name across all application servers.
>
>    (And yes, I know that hashes are not perfect and collisions can
>     occur.  Highly unlikely if we choose a good hash)

This sounds like a bad idea on many levels. Don't do it. Actually, i
think the driver is ok and the real problem is pgbouncer.

I have another solution to your problem:

You said that there are 100s of Servers, i assume that there is some
money behind that. Talk to the pgbouncer developers. Ask them to analyze
your problem and what it would cost to fix it. Ask them what it would
cost to make pgbouncer fully compliant, because it's probably not the
only feature you will miss. Figure out if this is cheaper than replacing
/ upgrading your hardware with something powerful enough to handle the
load without pgbouncer. Pick the cheaper solution. Done.

"Fixing" the jdbc driver is probably not a stable long term solution,
even if it helps with your most immediate problem.


Till

pgsql-jdbc by date:

Previous
From: Mark Lewis
Date:
Subject: Re: pg jdbc and dbcp error
Next
From: Josh Berkus
Date:
Subject: Re: Prepared Statements vs. pgbouncer