Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id D3DBE9FB942 for ; Fri, 9 Mar 2007 14:36:39 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 26878-07 for ; Fri, 9 Mar 2007 14:36:34 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from relay00.pair.com (relay00.pair.com [209.68.5.9]) by postgresql.org (Postfix) with SMTP id 8230A9FB907 for ; Fri, 9 Mar 2007 14:36:34 -0400 (AST) Received: (qmail 91288 invoked from network); 9 Mar 2007 18:36:32 -0000 Received: from 67.125.72.226 (HELO D9GKB4C1) (67.125.72.226) by relay00.pair.com with SMTP; 9 Mar 2007 18:36:32 -0000 X-pair-Authenticated: 67.125.72.226 From: "Gary Greenberg" To: Subject: Re: Error while retrieving generated keys Date: Fri, 9 Mar 2007 10:36:35 -0800 Message-ID: <030801c76279$de152100$740a3c0a@D9GKB4C1> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0309_01C76236.CFF1E100" X-Mailer: Microsoft Office Outlook 11 In-reply-to: Thread-Index: AcdiBiJppFl3dDJOQo6PYDrem67OaAAcXfzg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.002 tagged_above=0 required=5 tests=BAYES_50, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200703/87 X-Sequence-Number: 16801 This is a multi-part message in MIME format. ------=_NextPart_000_0309_01C76236.CFF1E100 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I see it now. It should have been, however, mentioned in documentation for the JDBC driver. I have also reviewed a recent thread http://archives.postgresql.org/pgsql-jdbc/2007-03/msg00038.php on a similar topic. The gist of it was how to overcome the deficiency of JDBC3 driver using JDBC1 features. It looks to me that you, guys, are missing the primary point: Ability to retrieve auto-generated key is one of the key features of JDB3. It exists for over 2 years and all JDBC3 drivers I know of, supports it. A lot of frameworks (JPA, Hibernate, etc.) are relying on it. It means that they won't work with PostgreSQL. It also means that developers must do a lot of extra tinkering to adopt many standard apps for PostgreSQL. In essence it means that PostgreSQL has fallen into the third world of database engines. I used to work a lot with PostgreSQL in mid-90s and loved it but I just recently returned to this world from working with Oracle, Sybase, etc. I am really disappointed that PostgreSQL is becoming a fossil. If there are no plans to make this feature work in the very near future, I'll be pushing for replacement of the engine. _____ From: QuanZongliang [mailto:quanzongliang@hotmail.com] Sent: Thursday, March 08, 2007 8:48 PM To: Gary Greenberg Cc: pgsql-jdbc@postgresql.org Subject: RE: [JDBC] Error while retrieving generated keys from AbstractJdbc3Connection.java: 348 public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) 349 throws SQLException 350 { 351 if (autoGeneratedKeys != Statement.NO_GENERATED_KEYS) 352 throw new PSQLException(GT.tr("Returning autogenerated keys is not supported."), PSQLState.NOT_IMPLEMENTED); 353 return prepareStatement(sql); 354 } So, it is not supported. Only the prepareStatement(sql, Statement.NO_GENERATED_KEYS) can be used. _____ From: gary@icontrol.com To: pgsql-jdbc@postgresql.org Subject: [JDBC] Error while retrieving generated keys Date: Thu, 8 Mar 2007 19:49:52 -0800 My application trew the following exception: org.postgresql.util.PSQLException: Returning autogenerated keys is not supported. at org.postgresql.jdbc3.AbstractJdbc3Connection.prepareStatement(AbstractJdbc3C onnection.java:352) at org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConn ection.java:394) at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepare Statement(PoolingDataSource.java:370) I am using 8.2-504.jdbc3 driver with the PostgreSql 8.0.8 on SUSE Linux. I have not seen anywhere in the documentation that this standard JDBC3 feature is not supported. Can anyone explain it to me, please. ------=_NextPart_000_0309_01C76236.CFF1E100 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

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

I have also reviewed a recent = thread = http://archives.postgresql.org/pgsql-jdbc/2007-03/msg00038.php on a similar topic.

The gist of it was how to overcome = the deficiency of JDBC3 driver using JDBC1 = features.

It looks to me that you, guys, are = missing the primary point:

 

Ability to retrieve auto-generated = key is one of the key features of JDB3. It exists for over 2 years and all = JDBC3 drivers I know of, supports it.

A lot of frameworks (JPA, = Hibernate, etc.) are relying on it. It means that they won’t work with = PostgreSQL.

It also means that developers must = do a lot of extra tinkering to adopt many standard apps for = PostgreSQL.

In essence it means that PostgreSQL = has fallen into the third world of database = engines.

I used to work a lot with = PostgreSQL in mid-90s and loved it but I just recently returned to this world from working = with Oracle, Sybase, etc.

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

 

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

 


From: = QuanZongliang [mailto:quanzongliang@hotmail.com]
Sent: Thursday, March 08, = 2007 8:48 PM
To: Gary Greenberg
Cc: = pgsql-jdbc@postgresql.org
Subject: RE: [JDBC] Error = while retrieving generated keys

 

from AbstractJdbc3Connection.java:
 
348    public PreparedStatement prepareStatement(String = sql, int autoGeneratedKeys)
349    throws SQLException
350    {
351        if (autoGeneratedKeys !=3D = Statement.NO_GENERATED_KEYS)
352            = throw new PSQLException(GT.tr("Returning autogenerated keys is not supported."), PSQLState.NOT_IMPLEMENTED);
353        return = prepareStatement(sql);
354    }

So, it is not supported.

Only the prepareStatement(sql, Statement.NO_GENERATED_KEYS) can be = used.


From: gary@icontrol.com
To: pgsql-jdbc@postgresql.org
Subject: [JDBC] Error while retrieving generated keys
Date: Thu, 8 Mar 2007 19:49:52 -0800

My application trew the following = exception:

 

org.postgresql.util.PSQLException: Returning = autogenerated keys is not supported.

        at org.postgresql.jdbc3.AbstractJdbc3Connection.prepareStatement(AbstractJdb= c3Connection.java:352)

        at org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingC= onnection.java:394)

        at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prep= areStatement(PoolingDataSource.java:370)

 

I am using 8.2-504.jdbc3 driver with the PostgreSql = 8.0.8 on SUSE Linux.

I have not seen anywhere in the documentation that = this standard JDBC3 feature is not supported.

Can anyone explain it to me, = please.

------=_NextPart_000_0309_01C76236.CFF1E100--