Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id E6C9F9FBB97 for ; Fri, 9 Mar 2007 19:32:17 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 40856-07 for ; Fri, 9 Mar 2007 19:32:14 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by postgresql.org (Postfix) with SMTP id 6929A9FBB2F for ; Fri, 9 Mar 2007 19:32:14 -0400 (AST) Received: (qmail 15069 invoked from network); 9 Mar 2007 23:32:12 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.14?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 9 Mar 2007 23:32:12 -0000 In-Reply-To: <031f01c7628f$fed55e30$740a3c0a@D9GKB4C1> References: <031f01c7628f$fed55e30$740a3c0a@D9GKB4C1> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: multipart/alternative; boundary=Apple-Mail-24--245058678 Message-Id: <1B82A631-0DB7-4D4D-A506-8571342C8907@fastcrypt.com> Cc: "'Heikki Linnakangas'" , From: Dave Cramer Subject: Re: Error while retrieving generated keys Date: Fri, 9 Mar 2007 18:32:33 -0500 To: Gary Greenberg X-Mailer: Apple Mail (2.752.3) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/93 X-Sequence-Number: 16807 --Apple-Mail-24--245058678 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=WINDOWS-1252; delsp=yes; format=flowed On 9-Mar-07, at 4:14 PM, Gary Greenberg wrote: > See my responses inline: > > > > -----Original Message----- > From: Heikki Linnakangas [mailto:hlinnaka@gmail.com] On Behalf Of =20 > Heikki Linnakangas > Sent: Friday, March 09, 2007 11:31 AM > To: Gary Greenberg > Cc: pgsql-jdbc@postgresql.org > Subject: Re: [JDBC] Error while retrieving generated keys > > > > Gary Greenberg wrote: > > > I see it now. It should have been, however, mentioned in =20 > documentation for > > > the JDBC driver. > > > > Agreed, this question has come up many times recently. Would you =20 > like to > > write a paragraph or two explaining the situation and the workaround? > > > > I don't know about an easy workaround. Especially while using =20 > frameworks. > > I am using Spring framework with Hibernate mapping and a lot of low =20= > level Java code is hidden from me. I do not have a particular =20 > desire to go back to plain JDBC calls. If I have to, I'd replace =20 > INSERT statement with a call to a stored function returning key =20 > value. But as said in my original email it is a lot of additional =20 > hassle. > > Hibernate deals with this just fine. You just have to specify the =20 correct KeyGenerator. > > > > In essence it means that PostgreSQL has fallen into the third =20 > world of > > > database engines. > > ... > > > I am really disappointed that PostgreSQL is becoming a fossil. > > > > ;-) Now you're exaggerating. > > Am I? Who, in his right mind will go back from using JPA or =20 > Hibernate to plain old JDBC calls? > > Should we go to managing transactions manually, OR mapping, etc? > > It would be exaggerating if I=92d offer to go back to punch cards or =20= > coding in assembler. (I do remember it). > > > If there are no plans to make this feature work in the very near =20 > future, > > > I'll be pushing for replacement of the engine. > > > > Ken Johanson posted a preliminary patch in February, but there was a > > bunch of issues with it. This is an open source project, so if you'd > > like to see it happen, patches are more than welcome. > > I can look up at this patch and see if I can contribute to fix it. =20 > Unfortunately I am on tight project schedule. > > How do I download the patch, though? > > -- > > Heikki Linnakangas > > EnterpriseDB http://www.enterprisedb.com > > --Apple-Mail-24--245058678 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=WINDOWS-1252
On 9-Mar-07, at = 4:14 PM, Gary Greenberg wrote:

See my = responses inline:

=A0

-----Original = Message-----
From: Heikki Linnakangas [mailto:hlinnaka@gmail.com] On = Behalf Of Heikki Linnakangas
Sent: Friday, = March 09, 2007 11:31 AM
To: Gary = Greenberg
Cc: pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] Error while retrieving generated = keys

Gary Greenberg wrote:

> I see it now. It should have = been, however, mentioned in documentation for> the JDBC = driver.

=A0

Agreed, this question has come up = many times recently. Would you like to

write a paragraph or two explaining = the situation and the workaround?

=A0

I don't know about an easy = workaround. Especially while using frameworks.I am using Spring framework with Hibernate mapping and a = lot of low level Java code is hidden from me. I do not have a particular = desire to go back to plain JDBC calls. If I have to, I'd replace INSERT = statement with a call to a stored function returning key value. But as = said in my original email it is a lot of additional hassle.

> In essence it means that PostgreSQL has fallen into = the third world of

> database engines.

=A0> I am really disappointed that PostgreSQL is = becoming a fossil.

=A0

;-) Now you're = exaggerating.

Am I? Who, in his right mind will go back from using JPA or = Hibernate to plain old JDBC calls?Should we go to managing transactions manually, OR mapping, = etc?

It would be exaggerating if I=92d = offer to go back to punch cards or coding in assembler. (I do remember = it).

> If there are no plans to make = this feature work in the very near future,> I'll be = pushing for replacement of the engine.

=A0

Ken Johanson posted a preliminary = patch in February, but there was a

bunch of issues with it. This is an = open source project, so if you'd

like to see it happen, patches are = more than welcome.

I can look up at this patch and see = if I can contribute to fix it. Unfortunately I am on tight project = schedule.

How do I download the patch, = though?

--

=A0=A0 Heikki = Linnakangas

=A0=A0 EnterpriseDB=A0=A0 http://www.enterprisedb.com


<= /HTML>= --Apple-Mail-24--245058678--