You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Tobias Trelle <to...@codecentric.de> on 2011/04/07 14:52:38 UTC

Re: same jpa query generates different SQLs

Marc Logemann wrote:
> 
> created an issue for it. Thanks for your ideas to make the cache
> disablement query based....
> 

Dear Marc,

can you please provide a link to this issue? I'm facing the same problem
with OpenJPA 2.0.1 und DB2 V9:

I have a query based on two Date parameters (amongst others). The first time
the query is executed, it runs fine and uses SQL type DATE:


    ...
    WHERE ((t0.A = ? OR t0.B = ? OR t0.C= ?) AND t0.Z >= ? AND t0.Z <= ?) 
[params=(int) 41140, (int) 41140, (int) 41140, (Date) 2010-08-01, (Date)
2010-12-31]


The second execution looks like this ...


    ...
    WHERE ((t0.A= ? OR t0.B= ? OR t0.C= ?) AND t0.Z >= ? AND t0.Z <= ?) 
[params=(int) 41140, (int) 41140, (int) 41140, (Timestamp) 2010-08-01
14:47:05.812, (Timestamp) 2010-12-31 14:47:05.812]


... and fails with 

   DB2 SQL Error: SQLCODE=-181, SQLSTATE=22007

because the DB2 column is of type DATE.

Will we run into performance issues if we disable the QuerySQLCache? Our
persistence unit uses only two named queries.

Cheers,
Tobias



--
View this message in context: http://openjpa.208410.n2.nabble.com/same-jpa-query-generates-different-SQLs-tp6081417p6249868.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: same jpa query generates different SQLs

Posted by Marc Logemann <li...@logemann.org>.
Hi,

the issue is: https://issues.apache.org/jira/browse/OPENJPA-1955

Seems nobody cared so far ;-) Feel free to vote up (if this is possible). 

Greetings to Fabian Lange btw. Just noticed you both work for the same company. He knows me from Nokia-Siemens back then.

---
regards
Marc Logemann
http://www.logemann.org
http://www.logentis.de




Am 07.04.2011 um 14:52 schrieb Tobias Trelle:

> 
> Marc Logemann wrote:
>> 
>> created an issue for it. Thanks for your ideas to make the cache
>> disablement query based....
>> 
> 
> Dear Marc,
> 
> can you please provide a link to this issue? I'm facing the same problem
> with OpenJPA 2.0.1 und DB2 V9:
> 
> I have a query based on two Date parameters (amongst others). The first time
> the query is executed, it runs fine and uses SQL type DATE:
> 
> 
>    ...
>    WHERE ((t0.A = ? OR t0.B = ? OR t0.C= ?) AND t0.Z >= ? AND t0.Z <= ?) 
> [params=(int) 41140, (int) 41140, (int) 41140, (Date) 2010-08-01, (Date)
> 2010-12-31]
> 
> 
> The second execution looks like this ...
> 
> 
>    ...
>    WHERE ((t0.A= ? OR t0.B= ? OR t0.C= ?) AND t0.Z >= ? AND t0.Z <= ?) 
> [params=(int) 41140, (int) 41140, (int) 41140, (Timestamp) 2010-08-01
> 14:47:05.812, (Timestamp) 2010-12-31 14:47:05.812]
> 
> 
> ... and fails with 
> 
>   DB2 SQL Error: SQLCODE=-181, SQLSTATE=22007
> 
> because the DB2 column is of type DATE.
> 
> Will we run into performance issues if we disable the QuerySQLCache? Our
> persistence unit uses only two named queries.
> 
> Cheers,
> Tobias
> 
> 
> 
> --
> View this message in context: http://openjpa.208410.n2.nabble.com/same-jpa-query-generates-different-SQLs-tp6081417p6249868.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.