Re: Error reporting issue in SimpleParameterList

Поиск
Список
Период
Сортировка
От
Тема Re: Error reporting issue in SimpleParameterList
Дата
Msg-id B998A44C8986644EA8029CFE6396A9246F4C9F@exqld2-bne.nexus.csiro.au
обсуждение исходный текст
Ответ на Error reporting issue in SimpleParameterList  (<Nathan.Keynes@csiro.au>)
Ответы Re: Error reporting issue in SimpleParameterList  (Kris Jurka <books@ejurka.com>)
Список 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

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: "Kalle Hallivuori"
Дата:
Сообщение: Copy with Streams only for 8.3dev
Следующее
От: "Boom Roos"
Дата:
Сообщение: Bug report and patch: PreparedStatement.setObject(int, Object) does not infer java.lang.Byte