Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id D54B263519B for ; Thu, 27 Aug 2009 11:14:27 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 99589-10 for ; Thu, 27 Aug 2009 14:14:04 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by mail.postgresql.org (Postfix) with ESMTP id 4C73E6354DF for ; Thu, 27 Aug 2009 11:04:36 -0300 (ADT) Received: from 122-57-44-76.jetstream.xtra.co.nz ([122.57.44.76] helo=[192.168.1.3]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1MgfaW-0007jV-4c; Fri, 28 Aug 2009 02:04:28 +1200 Message-ID: <4A96926B.3010805@opencloud.com> Date: Fri, 28 Aug 2009 02:04:27 +1200 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Stephen Nelson CC: pgsql-jdbc@postgresql.org Subject: Re: JDBC driver with JPA handling identities incorrectly References: <60B13898-8BF7-4307-B6FF-D53EC3D62362@eccostudio.com> In-Reply-To: <60B13898-8BF7-4307-B6FF-D53EC3D62362@eccostudio.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=AWL=0.000, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/77 X-Sequence-Number: 19926 Stephen Nelson wrote: > Hi, > > I created a thread for this at > http://stackoverflow.com/questions/1333596/postgresql-identity-in-jpa-single-table-hierarchy > which details the full environment and code I was attempting to run. > > Briefly my environment is: > > PostgreSQL 8.3 > JDBC Driver postgresql-8.4-701.jdbc4 > > This resulted in an error when using a JPA generation type of IDENTITY > in a single table inheritance hierarchy. The discriminator was a String > but was trying to be parsed as a long by the framework. For demo > purposes when using a String that was a parseable value e.g. 123 the > error did not occur but the framework believed the discriminator value > was the primary key. > > I switched the JDBC driver to postgresql-8.3-605.jdbc4.jar and the > problem doesn't seem to occur. > > I'm running Java 6 so believed the latest driver to be the correct one > even though I'm not running the 8.4 server. > > Please let me know if you need any further information or if I can > assist in fixing the issue. Hard to say what is happening here without knowing what JDBC calls your JPA layer actually makes. Do you have a plain JDBC testcase that shows the problem? -O