Re: Error reporting issue in SimpleParameterList

From: <Nathan(dot)Keynes(at)csiro(dot)au>
To: <books(at)ejurka(dot)com>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Error reporting issue in SimpleParameterList
Date: 2007-06-21 01:14:51
Message-ID: B998A44C8986644EA8029CFE6396A9246F4C9F@exqld2-bne.nexus.csiro.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


> Getting the names for the oids is tough from this part of the
> code so I
> don't think we can do that. Also I think this is supposed to
> be a "can't
> happen" error that's more of an assert than a message for an
> end user.
> Do you have an example of how to trigger this condition?

Hi Kris,

I've been trying to put together a minimal example of what we were
doing to trigger it, but unfortunately I haven't been able to reproduce
it outside of the original (too large for a test case) dataset yet. We
did trace it to code that was conceptually something like this:

stmt.executeUpdate("create table TEMP1 ( value1 BIGINT )" );
conn.commit();
PreparedStatement ps = conn.prepareStatement("insert into TEMP1
(value1) values (?)");
ps.setObject( 1, new Integer(123) );
ps.addBatch();
ps.setNull( 1, Types.BIGINT );
ps.addBatch();
ps.executeBatch();
ps.setNull( 1, Types.BIGINT );
ps.addBatch();
ps.setObject( 1, new Integer(234) );
ps.addBatch();
ps.executeBatch();

Basically, batch inserts with a BIGINT column, and mixing setObject()
with Integer values with setNull with explicit BIGINT type. The code
fell over on the second executeBatch() although there was no apparent
distinction between the batches for the column it complained about.
Changing the setObject call to eg
setObject( 1, new Integer(123), Types.BIGINT );
did fix the problem for us - at the time I assumed that the code was
complaining about the mixing of INT4 with INT8 in the batch, but it's
looking like there was more to it than that.

This was using Postgres 8.2.3, JDBC driver 8.2-504.

I don't know if the above is particularly helpful - I'll follow up
if/when I can get a reliable test case to reproduce.

Cheers,
Nathan

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message EBIHARA, Yuichiro 2007-06-21 05:21:03 Re: standard LOB support
Previous Message Kalle Hallivuori 2007-06-20 21:48:56 Copy with Streams only for 8.3dev