Re: Problems with protocol V3 after migration to latest driver

From: "Alexey Yudichev" <Alexey(at)francoudi(dot)com>
To: "Kris Jurka" <books(at)ejurka(dot)com>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Problems with protocol V3 after migration to latest driver
Date: 2004-10-25 07:36:11
Message-ID: 8BCBF9DB739F034B87FE7C7D30EAE55C026AC203@hqex2k.francoudi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Thanks a lot for the fixes, will try new jars today, however, this planner problem will anyway prevent me from using V3. I was wrong, it DOES fix the performance problem if I force V2. So I just added protocolVersion=2 to all of my pool URLs for now, will wait for 8.0 server release to use V3 protocol.

Over the weekend I have discovered another problem which only appears when using new 8.0 JDBC drivers, regardless of protocol version. The bad thing is that it only appears on ONE of my absolutely identical server installations (same version on both - postgresql-server-7.4.5-1PGDG).

The problem is:

Table "public.temp"
Column | Type | Modifiers
--------+------+-----------
c | oid |

Class.forName("org.postgresql.Driver");
Connection c = DriverManager.getConnection("jdbc:postgresql://host/db?compatible=7.1&user=xxx&password=yyy");
c.setAutoCommit(false);
PreparedStatement st = c.prepareStatement("INSERT INTO temp (c) values (?)");
st.setBytes(1, "yahoo".getBytes("UTF-8")); //exception here
st.executeUpdate();
[...]

results in
java.sql.SQLException: ERROR: large object 36376616 does not exist
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1187)
at org.postgresql.core.v3.QueryExecutorImpl.receiveFastpathResult(QueryExecutorImpl.java:409)
at org.postgresql.core.v3.QueryExecutorImpl.fastpathCall(QueryExecutorImpl.java:345)
at org.postgresql.fastpath.Fastpath.fastpath(Fastpath.java:67)
at org.postgresql.fastpath.Fastpath.fastpath(Fastpath.java:106)
at org.postgresql.fastpath.Fastpath.getInteger(Fastpath.java:118)
at org.postgresql.largeobject.LargeObject.<init>(LargeObject.java:89)
at org.postgresql.largeobject.LargeObjectManager.open(LargeObjectManager.java:150)
at org.postgresql.jdbc2.AbstractJdbc2Statement.setBytes(AbstractJdbc2Statement.java:1011)
[...]

I repeat, with 7.4 drivers it works OK and, surprisingly, it works OK even with newest drivers on one of two server installations I have.

-----Original Message-----
From: Kris Jurka [mailto:books(at)ejurka(dot)com]
Sent: Saturday, October 23, 2004 1:12 AM
To: Alexey Yudichev
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] Problems with protocol V3 after migration to latest driver

> On Fri, 22 Oct 2004, Alexey Yudichev wrote:
>
> > I have recently tried to migrate to pgdev.307.jdbc3 driver and got
> > several problems.
> >
> > [ setNull(i, Types.BOOLEAN) doesn't work]

Fixed.

> > [ setNull(i, Types.VARBINARY) doesn't work with compatibleVersion=7.1]

Fixed.

> > [ AT TIME ZONE INTERVAL ? doesn't work]

This looks like a server bug, I've reported it to the -bugs list. It does
appear that using " AT TIME ZONE (?::interval) " is a reasonable
workaround.

I've put up newly built jar files if you'd like to give them a test:

http://www.ejurka.com/pgsql/jars/alexey/

Kris Jurka

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2004-10-25 08:06:42 Re: Problems with protocol V3 after migration to latest driver
Previous Message Kris Jurka 2004-10-25 04:57:59 Re: Translation update: pt_BR