Thread: domains handling problem

domains handling problem

From
Віталій Тимчишин
Date:
Hello.

Today I've got next exception on postgresql 9.0-801 jdbc4 driver:
Caused by: org.postgresql.util.PSQLException: Unsupported Types value: 2,001
        at org.postgresql.jdbc2.AbstractJdbc2Statement.setObject(AbstractJdbc2Statement.java:1745)
        at org.postgresql.jdbc3.AbstractJdbc3Statement.setObject(AbstractJdbc3Statement.java:1483)
        at org.postgresql.jdbc3g.AbstractJdbc3gStatement.setObject(AbstractJdbc3gStatement.java:47)
        at org.postgresql.jdbc4.AbstractJdbc4Statement.setObject(AbstractJdbc4Statement.java:69)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.setObject(AbstractJdbc2Statement.java:1751)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.setObject(DelegatingPreparedStatement.java:163)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.setObject(DelegatingPreparedStatement.java:163)
        at org.springframework.jdbc.core.StatementCreatorUtils.setValue(StatementCreatorUtils.java:356)
        at org.springframework.jdbc.core.StatementCreatorUtils.setParameterValueInternal(StatementCreatorUtils.java:216)
        at org.springframework.jdbc.core.StatementCreatorUtils.setParameterValue(StatementCreatorUtils.java:144)
        at org.springframework.jdbc.core.simple.AbstractJdbcInsert.setParameterValues(AbstractJdbcInsert.java:611)
        at org.springframework.jdbc.core.simple.AbstractJdbcInsert.access$1(AbstractJdbcInsert.java:602)
        at org.springframework.jdbc.core.simple.AbstractJdbcInsert$1.createPreparedStatement(AbstractJdbcInsert.java:439)
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:580)

After looking a little deeper I've foudn out that driver report domain type as Types.DISTINCT, but does not accept it in setObject call. And spring library uses metadata to fill default SQL types to be sent to driver. I did a workaround by hard-wiring Types.OTHER, but I suppose this to be driver bug as driver should accept any sql type it provides from metadata.

--
Best regards,
 Vitalii Tymchyshyn

Re: domains handling problem

From
Kris Jurka
Date:

On Tue, 22 Feb 2011, ??????? ???????? wrote:

> Today I've got next exception on postgresql 9..0-801 jdbc4 driver:
> Caused by: org.postgresql.util.PSQLException: Unsupported Types value: 2,001
>         atorg.postgresql.jdbc2.AbstractJdbc2Statement.setObject(AbstractJdbc2Statemen
> t.java:1745)
>
> After looking a little deeper I've foudn out that driver report domain type
> as Types.DISTINCT, but does not accept it in setObject call. And spring
> library uses metadata to fill default SQL types to be sent to driver. I did
> a workaround by hard-wiring Types.OTHER, but I suppose this to be driver bug
> as driver should accept any sql type it provides from metadata.
>

I concur.  Fixed in CVS for 8.2+.

Kris Jurka

Re: domains handling problem

From
Vitalii Tymchyshyn
Date:
20.03.11 03:00, Kris Jurka написав(ла):
>
>
> On Tue, 22 Feb 2011, ??????? ???????? wrote:
>> After looking a little deeper I've foudn out that driver report
>> domain type
>> as Types.DISTINCT, but does not accept it in setObject call. And spring
>> library uses metadata to fill default SQL types to be sent to driver.
>> I did
>> a workaround by hard-wiring Types.OTHER, but I suppose this to be
>> driver bug
>> as driver should accept any sql type it provides from metadata.
>>
>
> I concur. Fixed in CVS for 8.2+.
>
Thanks. Welcome back to the list. Did not hear from you for some time.
Hope you've had a good time.

Best regards, Vitalii Tymchyshyn