Re: postgresql-8.1-413.jdbc3.jar ignoring setPrepareThreshold(); - Mailing list pgsql-jdbc

From Dave Cramer
Subject Re: postgresql-8.1-413.jdbc3.jar ignoring setPrepareThreshold();
Date
Msg-id 491f66a50812181657v60398fb0wb6b907f418293610@mail.gmail.com
Whole thread Raw
In response to Re: postgresql-8.1-413.jdbc3.jar ignoring setPrepareThreshold();  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-jdbc


On Thu, Dec 18, 2008 at 6:56 PM, Oliver Jowett <oliver@opencloud.com> wrote:
Jeremiah Jahn wrote:
I have slight problem on a postgresql-server-8.1.11-1PGDG.rhel4 db.
The first statement below runs fine. But the second two statements
return no results. When these statement are not run as prepared
statements they work fine. I need to run them as a prepared statement
because of the parameterization, but I don't want the server to cache
the prepared nature of the statements. These statements worked fine on
an old 7.3 driver. The only differendce I could see was that the driver
didn't prepare them.

It's not at all clear what you are trying to do here or what exactly the problem you see is.

For example, from the server logs, the driver is not using named statements for *any* of those queries, which seems to contradict what you're describing. And the queries are identical. And you haven't given any parameter values or any of your code to look at. So it's impossible to diagnose anything from that.

If I understand you, you don't want the driver to prepare them at all, but you want to use JDBC prepared statements.
The driver is using unnamed statements here, the prepareThreshold determines when it will start using a named statement. You can get around this behaviour by using protocolVersion=2 as a connection parameter.

Dave

pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: postgresql-8.1-413.jdbc3.jar ignoring setPrepareThreshold();
Next
From: Bruce Hyatt
Date:
Subject: Connection Refused