Re: Problems with Hibernate Discriminators and 9.0-801.jdbc4 - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Problems with Hibernate Discriminators and 9.0-801.jdbc4
Date
Msg-id AANLkTik_5mWeWs7RyVwa7-3BgDdgH1QR3XSYQntY9-7e@mail.gmail.com
Whole thread Raw
In response to Re: Problems with Hibernate Discriminators and 9.0-801.jdbc4  (sdavidr <david.ricoma@gmail.com>)
Responses Re: Problems with Hibernate Discriminators and 9.0-801.jdbc4  (Samuel Gendler <sgendler@ideasculptor.com>)
List pgsql-jdbc
On 29 March 2011 02:05, sdavidr <david.ricoma@gmail.com> wrote:

> Hibernate could receive a lot of numbers from a "returning *" but doesn't
> know what is the correct value. It expects to be the first element, but if
> is not, it fails.

Ok, so this is really a Hibernate bug. Hibernate needs to be fixed to
either request the correct generated column, or to choose the correct
column from the resultset. Of course, working out what the "correct
column" is could be tricky, but at least Hibernate has access to the
application's description of its data model so it's in a much better
position than the driver to do this.

> In another way, method from postgres driver getGeneratedKeys cannot return
> the full table, isn't it?

As Dave said, unless you explicitly ask for certain columns, it gives
you the entire inserted row because trying to determine a smaller set
of "generated" columns requires information that the driver doesn't
have. It's fine from a spec point of view to do this. Also, even if we
could find a smaller set of columns to return, there still might be
more than one and Hibernate would still fail ..

Oliver

pgsql-jdbc by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: idea to have driver return immediately after a query
Next
From: Craig Ringer
Date:
Subject: Re: JDBC gripe list