pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: dmp <danap@ttc-cmc.net>
To: pgsql-jdbc@postgresql.org
Subject: Re: Possible bug / regression from generated keys
Date: Wed, 07 Nov 2012 09:58:02 -0700
Message-ID: <509A931A.7010906@ttc-cmc.net> (raw)
In-Reply-To: <CAHVZnpFRa2qp8s_=42MV8s6p1=3W6A-K0bv+XgO=JtfmTHrAzA@mail.gmail.com>
References: <CAHVZnpFRa2qp8s_=42MV8s6p1=3W6A-K0bv+XgO=JtfmTHrAzA@mail.gmail.com>

I don't think a mountain of data is required for this one.
The ByteConverter class does not exist for the 9.1-902 so
was introduced later and is in 9.2-100X. Since git holds
no history I can not determine introduction, but a search
of this mailing list would perhaps lead to the reason for
the change.

What I can say is it looks like the column is binary. I
could compile the source for 9.2-1001 with output that
may tell you perhaps more information. I suspect though
someone here is more familiar with the change to understand
the problem. I would say this behavior is undesirable and
could be classified as a bug.

danap.


Peter Cooner wrote:
 > Summary:
 > I'm getting an exception from the ResultSet returned from
 > getGeneratedKey() from a batch insert PreparedStatement. When I use
 > any of the postgresql-9.2-100X.jdbc4.jar drivers I get exceptions, but
 > when I use postgresql-9.1-902.jdbc4.jar it works.
 >
 > Has anyone seen anything like this? How can I debug this problem
 > further? How should I go about determining if this is a bug?
 >
 > Exception:
 > java.lang.ArrayIndexOutOfBoundsException: 4
 >     at org.postgresql.util.ByteConverter.int8(ByteConverter.java:29)
 >     at 
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getLong(AbstractJdbc2ResultSet.java:2150)
 >     at 
org.postgresql.jdbc2.AbstractJdbc2ResultSet.internalGetObject(AbstractJdbc2ResultSet.java:142)
 >     at 
org.postgresql.jdbc3.AbstractJdbc3ResultSet.internalGetObject(AbstractJdbc3ResultSet.java:36)
 >     at 
org.postgresql.jdbc4.AbstractJdbc4ResultSet.internalGetObject(AbstractJdbc4ResultSet.java:296)
 >     at 
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getObject(AbstractJdbc2ResultSet.java:2703)
 > ...
 >
 > Usually followed later by this exception:
 > org.postgresql.util.PSQLException: Bad value for type long : ,
 >     at 
org.postgresql.jdbc2.AbstractJdbc2ResultSet.toLong(AbstractJdbc2ResultSet.java:2971)
 >     at 
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getLong(AbstractJdbc2ResultSet.java:2163)
 >     at 
org.postgresql.jdbc2.AbstractJdbc2ResultSet.internalGetObject(AbstractJdbc2ResultSet.java:142)
 >     at 
org.postgresql.jdbc3.AbstractJdbc3ResultSet.internalGetObject(AbstractJdbc3ResultSet.java:36)
 >     at 
org.postgresql.jdbc4.AbstractJdbc4ResultSet.internalGetObject(AbstractJdbc4ResultSet.java:296)
 >     at 
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getObject(AbstractJdbc2ResultSet.java:2703)
 > ...
 >
 > Setup:
 > OS: Ubuntu 10.04
 > PG: 9.2
 > JDBC: postgresql-9.2-1001.jdbc4.jar
 >
 > I'm also using PostGIS 2.0.1 jar, Apache Commons DBUtils, and DBCP.
 >
 > I *believe* that it must have something to do with concurrent database
 > connections or connection reuse, but I haven't been successful at
 > creating a test case, despite trying for several days now.
 >
 > Suggestions? I've got a mountain of data - if anyone needs more details.





view thread (19+ messages)  latest in thread

Message-ID: <509A931A.7010906@ttc-cmc.net>
Permalink:  ../509A931A.7010906@ttc-cmc.net/
Also on:    postgresql.org/message-id/509A931A.7010906@ttc-cmc.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: danap@ttc-cmc.net
  Subject: Re: Possible bug / regression from generated keys
  In-Reply-To: <509A931A.7010906@ttc-cmc.net>
  References: <CAHVZnpFRa2qp8s_=42MV8s6p1=3W6A-K0bv+XgO=JtfmTHrAzA@mail.gmail.com> <509A931A.7010906@ttc-cmc.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox