Re: ResultSet.getClob() causing problems when used with JPA's @Lob - Mailing list pgsql-jdbc

From Andreas Joseph Krogh
Subject Re: ResultSet.getClob() causing problems when used with JPA's @Lob
Date
Msg-id 4D505B02.804@officenet.no
Whole thread Raw
In response to Re: ResultSet.getClob() causing problems when used with JPA's @Lob  (Radosław Smogura <rsmogura@softperience.eu>)
Responses Re: ResultSet.getClob() causing problems when used with JPA's @Lob
Re: ResultSet.getClob() causing problems when used with JPA's @Lob
List pgsql-jdbc
On 02/07/2011 09:11 AM, Radosław Smogura wrote:
> Hi,
> PGSQL doesn't have CLOB type, instead JDBC uses LOB, but PGSQL doesn't
have
> "clear" lob field type. It uses in table column with type OID, and
supporting
> table for storing large objects.
>
> Look at bug submited by me
> http://opensource.atlassian.com/projects/hibernate/browse/HHH-4617
> Should be fixed in 3.6.1 release.

I'm experiencing this with 3.6.1 so whatever that issue fixes,
MaterializedClobType (which is the default type Hibernate uses when it
sees @Lob on String-types) still uses ClobTypeDescriptor, which again
has this code:

protected X doExtract(ResultSet rs, String name, WrapperOptions options)
throws SQLException {
    return javaTypeDescriptor.wrap( rs.getClob( name ), options );
}

And it should be able to call rs.getClob().

It's not clear to me why the JDBC-driver for PG shouldn't just use
rs.getString() internally for getClob() calls? Requiring
special-handling in Hibernate for dealing with Strings by setting an
obscure property just doesn't seem right. And I don't want to set a
property to handle CLOB which might affect how I use BLOBs.

--
Andreas Joseph Krogh <andreak@officenet.no>
Senior Software Developer / CTO
Public key: http://home.officenet.no/~andreak/public_key.asc
------------------------+---------------------------------------------+
OfficeNet AS            | The most difficult thing in the world is to |
Rosenholmveien 25       | know how to do a thing and to watch         |
1414 Trollåsen          | somebody else doing it wrong, without       |
NORWAY                  | comment.                                    |
Org.nr: NO 981 479 076  |                                             |
                        |                                             |
Tlf:    +47 24 15 38 90 |                                             |
Fax:    +47 24 15 38 91 |                                             |
Mobile: +47 909  56 963 |                                             |
------------------------+---------------------------------------------+

pgsql-jdbc by date:

Previous
From: Radosław Smogura
Date:
Subject: Re: ResultSet.getClob() causing problems when used with JPA's @Lob
Next
From: Radosław Smogura
Date:
Subject: Re: ResultSet.getClob() causing problems when used with JPA's @Lob