Re: Bug: Cannot pass null in Parameter in Query for ISNULL

From: Mikko Tiihonen <mikko(dot)tiihonen(at)nitorcreations(dot)com>
To: bht(at)actrix(dot)gen(dot)nz
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Bug: Cannot pass null in Parameter in Query for ISNULL
Date: 2011-12-01 09:21:26
Message-ID: 4ED74716.7070904@nitorcreations.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On 12/01/2011 09:58 AM, bht(at)actrix(dot)gen(dot)nz wrote:
> Hi Oliver,
>
> Thanks for your reply. Onfortunately I cannot see a solution in your
> elaboration. However I am still confident that there will be one at
> some point in the future.
>
> From an application perspective it is of course nonsense to code
> variations of the same SQL statement depending on parameters having
> specific values as required by the workaround. In case of JPA this
> option does not even exist.
>
> A Java application programmer has to go through extreme hassle in such
> a simple case. That hassle is not worth it.

So far it has been established that the JPA implementation you are
using uses an unportable hack that happens to work for some DB vendors
but not with postgresql.

Can you comment on why our proposal to remove the hack from the JPA
implementation and replace it with the JDBC recommended way of sending
NULL is not the correct way forward?

This would enable the JPA driver to work with any DB vendor providing
a standard compliant JDBC driver such as postgres, mysql, oracle etc.

As the promise of a JPA layer is to abstract the DB specifics away,
when you report the issue to your JPA vendor it should be of high
priority to them to fix their code. In this particular case the
JPA implementation has the correct type information readily at hand
but the forgets to pass it to the JDBC driver as recommeneded in
JDBC specification.

PS. Have you tried if a newer version of the JPA implementation you are
using has already fixed the problem?

-Mikko

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2011-12-01 09:26:51 Re: Bug: Cannot pass null in Parameter in Query for ISNULL
Previous Message bht 2011-12-01 07:58:40 Re: Bug: Cannot pass null in Parameter in Query for ISNULL