bug with prepared statements and sql comments in 8.1-408.jdbc3 - Mailing list pgsql-jdbc

From mljv@planwerk6.de
Subject bug with prepared statements and sql comments in 8.1-408.jdbc3
Date
Msg-id 200706051302.57899.mljv@planwerk6.de
Whole thread Raw
Responses Re: bug with prepared statements and sql comments in 8.1-408.jdbc3  (Kris Jurka <books@ejurka.com>)
List pgsql-jdbc
Hi,

i am using hibernate3, postgresql 8.1 and pg-jdbc 8.1-408.jdbc3

when is set hibernate.use_sql_comments to true, hibernate sends sql comments
to the postgresql driver to ease debugging.

But the driver does not recognise the comment in respect of parameters:

Caused by: org.postgresql.util.PSQLException: Für den Parameter 2 wurde kein
Wert angegeben.
["No value for parameter 2 was specified"]

Hibernate send the following string to the driver:

      /*
   from
       customers As cu
   where
       cu.name = ? */ select
       [...]
       from
           Customer customer0_
       where
           customer0_.customer0_name=?

the driver doesnt see that the first "?" is inside a comment. That's my guess
from reading a very similar bug report:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-521
this one was tracked down in the oracle driver, so i guess postgresql has got
the same kind of bug.

if i can help to track down this bug, please contact me via PM.

--
kind regards,
janning


pgsql-jdbc by date:

Previous
From: Gregory Stark
Date:
Subject: Re: Array paramiters
Next
From: Kris Jurka
Date:
Subject: Re: bug with prepared statements and sql comments in 8.1-408.jdbc3