Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 543161337B8D for ; Mon, 7 Feb 2011 16:50:29 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 79948-05 for ; Mon, 7 Feb 2011 20:50:22 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ns1.officenet.no (unknown [195.159.87.244]) by mail.postgresql.org (Postfix) with ESMTP id 84BDE1337B8A for ; Mon, 7 Feb 2011 16:50:21 -0400 (AST) Received: from [79.161.204.50] (helo=[192.168.0.172]) by ns1.officenet.no with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1PmY2K-0003nD-Fj for pgsql-jdbc@postgresql.org; Mon, 07 Feb 2011 21:50:18 +0100 Message-ID: <4D505B02.804@officenet.no> Date: Mon, 07 Feb 2011 21:50:10 +0100 From: Andreas Joseph Krogh Organization: OfficeNet AS User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: ResultSet.getClob() causing problems when used with JPA's @Lob References: <201102070001.22259.andreak@officenet.no> <201102070911.20245.rsmogura@softperience.eu> In-Reply-To: <201102070911.20245.rsmogura@softperience.eu> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.107 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RDNS_NONE=0.793 X-Spam-Level: X-Archive-Number: 201102/35 X-Sequence-Number: 21433 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 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 | | ------------------------+---------------------------------------------+