From dschulze@knowledgefactor.com Tue Jun 5 23:27:10 2012 Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 67F1C98F709 for ; Tue, 5 Jun 2012 20:27:10 -0300 (ADT) Received: from hub024-ca-4.exch024.serverdata.net ([64.78.56.81]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Sc39Y-0005Lo-8i for pgsql-bugs@postgresql.org; Tue, 05 Jun 2012 23:27:09 +0000 Received: from MBX024-W1-CA-5.exch024.domain.local ([10.254.10.55]) by HUB024-CA-4.exch024.domain.local ([10.254.10.39]) with mapi id 14.02.0283.003; Tue, 5 Jun 2012 16:26:54 -0700 From: Dean Schulze To: "pgsql-bugs@postgresql.org" Subject: JDBC Driver can't read UUID from database Thread-Topic: JDBC Driver can't read UUID from database Thread-Index: AQHNQ3KwsGhwOY9PgES3PKvcQnGqQg== Date: Tue, 5 Jun 2012 23:26:53 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [173.160.63.169] Content-Type: multipart/alternative; boundary="_000_CBF3F1DC2E8dschulzeknowledgefactorcom_" MIME-Version: 1.0 X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/39 X-Sequence-Number: 33266 --_000_CBF3F1DC2E8dschulzeknowledgefactorcom_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I'm using Hibernate (3.6 and 4.0) with Postgresql 9.1. Our tables have UUI= Ds in them and your driver is trying to convert UUIDs to longs: Caused by: org.postgresql.util.PSQLException: Bad value for type long : dba= da1e4-a165-4601-b34e-d08428cd81df at org.postgresql.jdbc2.AbstractJdbc2ResultSet.toLong(AbstractJdbc2ResultSe= t.java:2796) at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getLong(AbstractJdbc2ResultS= et.java:2019) at org.postgresql.jdbc4.Jdbc4ResultSet.getBlob(Jdbc4ResultSet.java:52) at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getBlob(AbstractJdbc2ResultS= et.java:335) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav= a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor= Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.hibernate.engine.jdbc.internal.proxy.AbstractResultSetProxyHandler.c= ontinueInvocation(AbstractResultSetProxyHandler.java:104) ... 32 more I've tried chaining the Hibernate annotations to treat them as Strings and = CLOBs but I get the same exception. Driver versions I've tried are 9.0-801.jdbc4 and 9.1-901.jdbc4 This is a show stopper. --_000_CBF3F1DC2E8dschulzeknowledgefactorcom_ Content-Type: text/html; charset="us-ascii" Content-ID: <30F8D41DEECE2F4B8781E243C38CBE7D@exch024.domain.local> Content-Transfer-Encoding: quoted-printable

I'm using Hibernate (3.6 and 4.0) with Postgresql 9.1.  Our table= s have UUIDs in them and your driver is trying to convert UUIDs to longs:

Caused by: org.postgresql.= util.PSQLException: Bad value for type long : dbada1e4-a165-4601-b34= e-d08428cd81df

at o= rg.postgresql.jdbc2.AbstractJdbc2ResultSet.toLong(AbstractJdbc2ResultSet.java:2796)=

at o= rg.postgresql.jdbc2.AbstractJdbc2ResultSet.getLong(AbstractJdbc2ResultSet.java:2019= )

at o= rg.postgresql.jdbc4.Jdbc4ResultSet.getBlob(Jdbc4ResultSet.java:52)

at o= rg.postgresql.jdbc2.AbstractJdbc2ResultSet.getBlob(AbstractJdbc2ResultSet.java:335)=

at s= un.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at s= un.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at s= un.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25= )

at j= ava.lang.reflect.Method.invoke(Method.java:597)

at o= rg.hibernate.engine.jdbc.internal.proxy.AbstractResultSetProxyHandler.conti= nueInvocation(A= bstractResultSetProxyHandler.java:104)

... = 32 more


I've tried chaining the Hibernate annotations to treat them as Strings= and CLOBs but I get the same exception.

Driver versions I've tried are 9= .0-801.jdbc4 and 9.1-901.jdbc4

This is a show stopp= er.
--_000_CBF3F1DC2E8dschulzeknowledgefactorcom_-- From books@ejurka.com Wed Jun 6 08:13:13 2012 Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 9AB321179B40 for ; Wed, 6 Jun 2012 05:13:13 -0300 (ADT) Received: from mail63.csoft.net ([205.205.214.4]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1ScBMd-0007nt-Mo for pgsql-bugs@postgresql.org; Wed, 06 Jun 2012 08:13:12 +0000 Received: from mail63.csoft.net (localhost [127.0.0.1]) by mail63.csoft.net (Postfix) with ESMTP id 2FBBB2846A; Wed, 6 Jun 2012 04:12:58 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=csoft.net; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sel1; bh=QwGL3qDvVNMCwamfS/YWeQ2Rgt4=; b=ivp6hi izfCsOH8LWexd9i9oUhhbaiZN0tGUUzwLdABoYSRYHAYjzvcqEdpBvWZPKreOvlL uBsSxIN0VjVjW6VTQp7qnzdSDg9xz/0xQGiXuJPMLA+tS4KCq/8fhUA7v505RIWh I0f1iSAcCSv2iroeO29KoMrsNS1pDvC7iDgX0= Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail63.csoft.net (Postfix) with ESMTP id 0976128415; Wed, 6 Jun 2012 04:12:58 -0400 (EDT) Received: by leary.csoft.net (Postfix, from userid 1112) id 8FE4AA39D; Wed, 6 Jun 2012 04:12:57 -0400 (EDT) Date: Wed, 6 Jun 2012 04:12:56 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Dean Schulze cc: "pgsql-bugs@postgresql.org" Subject: Re: JDBC Driver can't read UUID from database In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 X-Pg-Spam-Score: -1.9 (-) Content-Type: TEXT/PLAIN; charset=ISO-8859-15 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Archive-Number: 201206/42 X-Sequence-Number: 33269 On Tue, 5 Jun 2012, Dean Schulze wrote: >=20 > I'm using Hibernate (3.6 and 4.0) with Postgresql 9.1. =A0Our tables have > UUIDs in them and your driver is trying to convert UUIDs to longs: >=20 This is a hibernate mapping problem, not a JDBC Driver problem. If you=20 have a plain ResultSet and call getString() on a UUID field, it will=20 certainly work. Mapping the UUID to BLOB or CLOB is incorrect. I'm not=20 sure why your attempt to map it to a String didn't work, but you are=20 not convincing Hibernate to use a plain getString call. Kris Jurka= From dschulze@knowledgefactor.com Mon Jun 11 02:44:07 2012 Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 9C6C9CAD8A8 for ; Sun, 10 Jun 2012 23:44:07 -0300 (ADT) Received: from hub024-ca-2.exch024.serverdata.net ([64.78.56.79]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Sdubr-0008QH-2e for pgsql-bugs@postgresql.org; Mon, 11 Jun 2012 02:44:06 +0000 Received: from MBX024-W1-CA-5.exch024.domain.local ([10.254.10.55]) by HUB024-CA-2.exch024.domain.local ([10.254.10.33]) with mapi id 14.02.0309.002; Sun, 10 Jun 2012 19:43:48 -0700 From: Dean Schulze To: Kris Jurka CC: "pgsql-bugs@postgresql.org" Subject: Re: JDBC Driver can't read UUID from database Thread-Topic: [BUGS] JDBC Driver can't read UUID from database Thread-Index: AQHNQ3KwsGhwOY9PgES3PKvcQnGqQpbtZs4AgAcFdYA= Date: Mon, 11 Jun 2012 02:43:47 +0000 Message-ID: <285378F79EC333408F3AAE73259CCD40626D6C@mbx024-w1-ca-5.exch024.domain.local> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [71.229.231.55] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/100 X-Sequence-Number: 33327 Thanks. Out of curiosity why didn't the driver map the Postgresql UUID to a Java UUID? On 6/6/12 2:12 AM, "Kris Jurka" wrote: > > >On Tue, 5 Jun 2012, Dean Schulze wrote: > >>=20 >> I'm using Hibernate (3.6 and 4.0) with Postgresql 9.1. Our tables have >> UUIDs in them and your driver is trying to convert UUIDs to longs: >>=20 > >This is a hibernate mapping problem, not a JDBC Driver problem. If you >have a plain ResultSet and call getString() on a UUID field, it will >certainly work. Mapping the UUID to BLOB or CLOB is incorrect. I'm not >sure why your attempt to map it to a String didn't work, but you are >not convincing Hibernate to use a plain getString call. > >Kris Jurka From books@ejurka.com Mon Jun 11 21:28:25 2012 Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 6815119F3D0 for ; Mon, 11 Jun 2012 18:28:25 -0300 (ADT) Received: from mail63.csoft.net ([205.205.214.4]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SeC9u-00068B-A5 for pgsql-bugs@postgresql.org; Mon, 11 Jun 2012 21:28:24 +0000 Received: from mail63.csoft.net (localhost [127.0.0.1]) by mail63.csoft.net (Postfix) with ESMTP id C3A3828417; Mon, 11 Jun 2012 17:28:07 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=csoft.net; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sel1; bh=CQ3RzkjoTn77uTuYYBcYHItulSM=; b=Xy4rDQ oKuu6sZrNyFoFU9BmPQMnc6P3Y7aexFFLt5yRzYVifm5R1/URWqXQZZVJUdxVebR vDuvCdgJRrXeOuNHohCJtCx0uAiJI3cIp4Gvw7iOSY0PIiQE51ZqO7lvLx0QwV8o n/SGRHy+IboW6MkCrbmB/4tWkg6hLB8yqYP30= Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail63.csoft.net (Postfix) with ESMTP id 95A3628404; Mon, 11 Jun 2012 17:28:07 -0400 (EDT) Received: by leary.csoft.net (Postfix, from userid 1112) id 7B774A1D9; Mon, 11 Jun 2012 17:28:07 -0400 (EDT) Date: Mon, 11 Jun 2012 17:28:07 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Dean Schulze cc: "pgsql-bugs@postgresql.org" Subject: Re: JDBC Driver can't read UUID from database In-Reply-To: <285378F79EC333408F3AAE73259CCD40626D6C@mbx024-w1-ca-5.exch024.domain.local> Message-ID: References: <285378F79EC333408F3AAE73259CCD40626D6C@mbx024-w1-ca-5.exch024.domain.local> User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/110 X-Sequence-Number: 33337 On Mon, 11 Jun 2012, Dean Schulze wrote: > Out of curiosity why didn't the driver map the Postgresql UUID to a Java > UUID? > The example I gave of calling getString must return a String and not another type. With a recent JDBC Driver and Java version, calling getObject will return a UUID object. Kris Jurka