Re: Prepared Statements vs. pgbouncer

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Paul Lindner <lindner(at)inuus(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Prepared Statements vs. pgbouncer
Date: 2007-09-29 01:05:54
Message-ID: 46FDA4F2.8080507@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Paul Lindner wrote:
> the assumption of a singular
> client->server backend is causing this problem.

Well, yes, that's fairly fundamental to the client-server protocol. It
sounds like pgbouncer is breaking the protocol.

You could perhaps do transparent statement/portal renaming in pgbouncer
but that seems to be only scratching the surface of the problem.
Consider your case here:

> * Client A creates statement S_1, fetches results.
> When finished the statement is put in a cleanup queue.
> * time passes
> * pgbouncer notices that client A is idle and reassigns backend to
> client B

Ok, now client A wakes up and wants to reuse S_1. What happens? The
backend that knows about S_1 is currently in use by B.

Changing the JDBC driver to handle a "server" that doesn't follow the
documented server protocol seems a bit backwards. I think you're going
to have to teach pgbouncer a whole lot more about statements and portals
to get this one working.

-O

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Paul Lindner 2007-09-29 02:15:22 Re: Prepared Statements vs. pgbouncer
Previous Message Paul Lindner 2007-09-29 00:25:13 Prepared Statements vs. pgbouncer