You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Harald Wellmann <Ha...@multi-m.de> on 2010/08/17 10:38:29 UTC
Strange warnings about query parameters
I'm getting warnings of the following type which do not make sense to me:
WARN openjpa.Runtime - Supplied user parameters "[category]" do not match
expected parameters "[]" for the prepared query "PreparedQuery: [select l
from DomainValue l where lower(l.category) like :category]
The query has one parameter :category, and a value for this parameter was
supplied. Why does OpenJPA expect an empty parameter set?
Best regards,
Harald
--
View this message in context: http://openjpa.208410.n2.nabble.com/Strange-warnings-about-query-parameters-tp5431171p5431171.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.
Re: Strange warnings about query parameters
Posted by Harald Wellmann <Ha...@multi-m.de>.
The funny thing is, it does not bomb. I turned on DEBUG logging and looked at
the generated SQL query which is ok. I also manually ran the SQL query to
verify the results.
All this happens in the context of a web app running on Glassfish 3.0.1, and
the problem is reproducible always within this application.
I tried to isolate the effect by running the same JPQL query in my unit test
environment where the same JPA model is used in a Java SE context, but in
that case the warning does not occur.
Let me know if there's anything I can do to pinpoint the problem.
Best regards,
Harald
--
View this message in context: http://openjpa.208410.n2.nabble.com/Strange-warnings-about-query-parameters-tp5431171p5435436.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.
Re: Strange warnings about query parameters
Posted by Pinaki Poddar <pp...@apache.org>.
Hi,
The warning message is surely an annoyance but reportedly does not return
erroneous results. In any case, I had committed a change 986744 on trunk
that corrects the problem.
Which version of OpenJPA is being used in the current context?
$ java -jar /path/to/openjpa.jar
will print the revision number.
-----
Pinaki
--
View this message in context: http://openjpa.208410.n2.nabble.com/Strange-warnings-about-query-parameters-tp5431171p5531811.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.
Re: Strange warnings about query parameters
Posted by Norman Maurer <no...@apache.org>.
We need to upgrade to openjpa 2.0.1 to get it fixed ;)
Bye,
Norman
2010/9/14 Eric Charles <er...@apache.org>:
> Hi Pinaki,
>
> We have OpenJPA 2.0.0 from maven.
> version id: openjpa-2.0.0-r422266:935683
> Apache svn revision: 422266:935683
>
> So we don't have yet change you committed in 986744.
> We will certainly get rid of the warning message at the next openjpa
> release.
>
> And many tks for your quick answer.
> Bye,
>
> Eric
>
>
> On 14/09/2010 21:52, Pinaki Poddar wrote:
>>
>> Hi,
>> The warning message is surely an annoyance but reportedly does not
>> return
>> erroneous results. In any case, I had committed a change 986744 on trunk
>> that corrects the problem.
>>
>> Which version of OpenJPA is being used in the current context?
>>
>> $ java -jar /path/to/openjpa.jar
>>
>> will print the revision number.
>>
>> -----
>> Pinaki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
Re: Strange warnings about query parameters
Posted by Eric Charles <er...@apache.org>.
Hi Pinaki,
We have OpenJPA 2.0.0 from maven.
version id: openjpa-2.0.0-r422266:935683
Apache svn revision: 422266:935683
So we don't have yet change you committed in 986744.
We will certainly get rid of the warning message at the next openjpa
release.
And many tks for your quick answer.
Bye,
Eric
On 14/09/2010 21:52, Pinaki Poddar wrote:
> Hi,
> The warning message is surely an annoyance but reportedly does not return
> erroneous results. In any case, I had committed a change 986744 on trunk
> that corrects the problem.
>
> Which version of OpenJPA is being used in the current context?
>
> $ java -jar /path/to/openjpa.jar
>
> will print the revision number.
>
> -----
> Pinaki
Re: Strange warnings about query parameters
Posted by Eric Charles <er...@apache.org>.
Hi Pinaki,
We have OpenJPA 2.0.0 from maven.
version id: openjpa-2.0.0-r422266:935683
Apache svn revision: 422266:935683
So we don't have yet change you committed in 986744.
We will certainly get rid of the warning message at the next openjpa
release.
And many tks for your quick answer.
Bye,
Eric
On 14/09/2010 21:52, Pinaki Poddar wrote:
> Hi,
> The warning message is surely an annoyance but reportedly does not return
> erroneous results. In any case, I had committed a change 986744 on trunk
> that corrects the problem.
>
> Which version of OpenJPA is being used in the current context?
>
> $ java -jar /path/to/openjpa.jar
>
> will print the revision number.
>
> -----
> Pinaki
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
Re: Strange warnings about query parameters
Posted by Pinaki Poddar <pp...@apache.org>.
> can anyone confirm whether it is just a cosmetic issue,
So far, by observation, the underlying query is not affected. And hence the
warning message is a mere annoyance. But I can not confirm that it could be
completely harmless in all situations, given the complexity of parameters
rebinding for prepared queries.
Revision 986744 fix the problem.
-----
Pinaki
--
View this message in context: http://openjpa.208410.n2.nabble.com/Strange-warnings-about-query-parameters-tp5431171p5740250.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.
Re: Strange warnings about query parameters
Posted by grrrr <jo...@su3analytics.com>.
Hi Folks,
Is there a JIRA for the issue described in this thread?
Also, can anyone confirm whether it is just a cosmetic issue, or is the
underlying query affected as well?
Thanks,
Joel
--
View this message in context: http://openjpa.208410.n2.nabble.com/Strange-warnings-about-query-parameters-tp5431171p5739575.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.
Re: Strange warnings about query parameters
Posted by Michael Dick <mi...@gmail.com>.
Hi Eric,
You'll actually need an OpenJPA 2.1.0-SNAPSHOT build to pick up Pinaki's
change - it's not in the 2.0.1 release.
Regards,
-mike
On Wed, Sep 15, 2010 at 4:20 AM, Eric Charles <er...@apache.org> wrote:
> Hi Pinaki,
> We upgraded our trunk to use OpenJPA 2.0.1 (r989424 > r986744 you talked
> about).
> We still have the same warning message.
> Tks,
> Eric
>
>
>
> On 14/09/2010 22:08, Eric Charles wrote:
>
>> Hi Pinaki,
>>
>> We have OpenJPA 2.0.0 from maven.
>> version id: openjpa-2.0.0-r422266:935683
>> Apache svn revision: 422266:935683
>>
>> So we don't have yet change you committed in 986744.
>> We will certainly get rid of the warning message at the next openjpa
>> release.
>>
>> And many tks for your quick answer.
>> Bye,
>>
>> Eric
>>
>>
>> On 14/09/2010 21:52, Pinaki Poddar wrote:
>>
>>> Hi,
>>> The warning message is surely an annoyance but reportedly does not
>>> return
>>> erroneous results. In any case, I had committed a change 986744 on trunk
>>> that corrects the problem.
>>>
>>> Which version of OpenJPA is being used in the current context?
>>>
>>> $ java -jar /path/to/openjpa.jar
>>>
>>> will print the revision number.
>>>
>>> -----
>>> Pinaki
>>>
>>
>>
>
Re: Strange warnings about query parameters
Posted by Eric Charles <er...@apache.org>.
Hi Mike & Pinaki,
Good to know.
We will wait on next OpenJPA official release (James code is working
fine with 2.0.1.).
Many Tks,
Eric
On 16/09/2010 14:31, Michael Dick wrote:
> Hi Eric,
>
> You'll actually need an OpenJPA 2.1.0-SNAPSHOT build to pick up Pinaki's
> change - it's not in the 2.0.1 release.
>
> Regards,
> -mike
>
>
> On Wed, Sep 15, 2010 at 4:20 AM, Eric Charles<er...@apache.org> wrote:
>
>> Hi Pinaki,
>> We upgraded our trunk to use OpenJPA 2.0.1 (r989424> r986744 you talked
>> about).
>> We still have the same warning message.
>> Tks,
>> Eric
>>
>>
>>
>> On 14/09/2010 22:08, Eric Charles wrote:
>>
>>> Hi Pinaki,
>>>
>>> We have OpenJPA 2.0.0 from maven.
>>> version id: openjpa-2.0.0-r422266:935683
>>> Apache svn revision: 422266:935683
>>>
>>> So we don't have yet change you committed in 986744.
>>> We will certainly get rid of the warning message at the next openjpa
>>> release.
>>>
>>> And many tks for your quick answer.
>>> Bye,
>>>
>>> Eric
>>>
>>>
>>> On 14/09/2010 21:52, Pinaki Poddar wrote:
>>>
>>>> Hi,
>>>> The warning message is surely an annoyance but reportedly does not
>>>> return
>>>> erroneous results. In any case, I had committed a change 986744 on trunk
>>>> that corrects the problem.
>>>>
>>>> Which version of OpenJPA is being used in the current context?
>>>>
>>>> $ java -jar /path/to/openjpa.jar
>>>>
>>>> will print the revision number.
>>>>
>>>> -----
>>>> Pinaki
>>>>
>>>
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
Re: Strange warnings about query parameters
Posted by Eric Charles <er...@apache.org>.
Hi Mike & Pinaki,
Good to know.
We will wait on next OpenJPA official release (James code is working
fine with 2.0.1.).
Many Tks,
Eric
On 16/09/2010 14:31, Michael Dick wrote:
> Hi Eric,
>
> You'll actually need an OpenJPA 2.1.0-SNAPSHOT build to pick up Pinaki's
> change - it's not in the 2.0.1 release.
>
> Regards,
> -mike
>
>
> On Wed, Sep 15, 2010 at 4:20 AM, Eric Charles<er...@apache.org> wrote:
>
>> Hi Pinaki,
>> We upgraded our trunk to use OpenJPA 2.0.1 (r989424> r986744 you talked
>> about).
>> We still have the same warning message.
>> Tks,
>> Eric
>>
>>
>>
>> On 14/09/2010 22:08, Eric Charles wrote:
>>
>>> Hi Pinaki,
>>>
>>> We have OpenJPA 2.0.0 from maven.
>>> version id: openjpa-2.0.0-r422266:935683
>>> Apache svn revision: 422266:935683
>>>
>>> So we don't have yet change you committed in 986744.
>>> We will certainly get rid of the warning message at the next openjpa
>>> release.
>>>
>>> And many tks for your quick answer.
>>> Bye,
>>>
>>> Eric
>>>
>>>
>>> On 14/09/2010 21:52, Pinaki Poddar wrote:
>>>
>>>> Hi,
>>>> The warning message is surely an annoyance but reportedly does not
>>>> return
>>>> erroneous results. In any case, I had committed a change 986744 on trunk
>>>> that corrects the problem.
>>>>
>>>> Which version of OpenJPA is being used in the current context?
>>>>
>>>> $ java -jar /path/to/openjpa.jar
>>>>
>>>> will print the revision number.
>>>>
>>>> -----
>>>> Pinaki
>>>>
>>>
Re: Strange warnings about query parameters
Posted by Eric Charles <er...@apache.org>.
Hi Pinaki,
We upgraded our trunk to use OpenJPA 2.0.1 (r989424 > r986744 you talked
about).
We still have the same warning message.
Tks,
Eric
On 14/09/2010 22:08, Eric Charles wrote:
> Hi Pinaki,
>
> We have OpenJPA 2.0.0 from maven.
> version id: openjpa-2.0.0-r422266:935683
> Apache svn revision: 422266:935683
>
> So we don't have yet change you committed in 986744.
> We will certainly get rid of the warning message at the next openjpa
> release.
>
> And many tks for your quick answer.
> Bye,
>
> Eric
>
>
> On 14/09/2010 21:52, Pinaki Poddar wrote:
>> Hi,
>> The warning message is surely an annoyance but reportedly does not
>> return
>> erroneous results. In any case, I had committed a change 986744 on trunk
>> that corrects the problem.
>>
>> Which version of OpenJPA is being used in the current context?
>>
>> $ java -jar /path/to/openjpa.jar
>>
>> will print the revision number.
>>
>> -----
>> Pinaki
>
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
Re: Strange warnings about query parameters
Posted by Eric Charles <er...@apache.org>.
Hi Pinaki,
We upgraded our trunk to use OpenJPA 2.0.1 (r989424 > r986744 you talked
about).
We still have the same warning message.
Tks,
Eric
On 14/09/2010 22:08, Eric Charles wrote:
> Hi Pinaki,
>
> We have OpenJPA 2.0.0 from maven.
> version id: openjpa-2.0.0-r422266:935683
> Apache svn revision: 422266:935683
>
> So we don't have yet change you committed in 986744.
> We will certainly get rid of the warning message at the next openjpa
> release.
>
> And many tks for your quick answer.
> Bye,
>
> Eric
>
>
> On 14/09/2010 21:52, Pinaki Poddar wrote:
>> Hi,
>> The warning message is surely an annoyance but reportedly does not
>> return
>> erroneous results. In any case, I had committed a change 986744 on trunk
>> that corrects the problem.
>>
>> Which version of OpenJPA is being used in the current context?
>>
>> $ java -jar /path/to/openjpa.jar
>>
>> will print the revision number.
>>
>> -----
>> Pinaki
>
Re: Strange warnings about query parameters
Posted by Eric Charles <er...@apache.org>.
Hi,
We also have these warning messages in apache james trunk project (in
unit test and in spring container).
The Query works just fine.
8923 WARN [main] openjpa.Runtime - Supplied user parameters "[domain, user]" do not match expected parameters "[]" for the prepared query "PreparedQuery: [SELECT vut FROM JamesVirtualUserTable vut WHERE (vut.user LIKE :use
vut.domain DESC] --> [SELECT t0.DOMAIN, t0.USER0, t0.TARGET_ADDRESS FROM VIRTUALUSERTABLE t0 WHERE ((t0.USER0 LIKE ? ESCAPE '\' OR t0.USER0 = ?) AND (t0.DOMAIN LIKE ? ESCAPE '\' OR t0.DOMAIN = ?)) ORDER BY t0.DOMAIN DESC]".
8939 TRACE [main] openjpa.jdbc.SQL -<t 958922509, conn 1153873934> executing prepstmnt 563165009
Should we worry about this ?
Is there a JIRA we can refer to ?
Tks,
Eric
On 18/08/2010 10:24, Harald Wellmann wrote:
> The funny thing is, it does not bomb. I turned on DEBUG logging and looked at
> the generated SQL query which is ok. I also manually ran the SQL query to
> verify the results.
>
> All this happens in the context of a web app running on Glassfish 3.0.1, and
> the problem is reproducible always within this application.
>
> I tried to isolate the effect by running the same JPQL query in my unit test
> environment where the same JPA model is used in a Java SE context, but in
> that case the warning does not occur.
>
> Let me know if there's anything I can do to pinpoint the problem.
>
> Best regards,
> Harald
>
Re: Strange warnings about query parameters
Posted by Eric Charles <er...@apache.org>.
Hi,
We also have these warning messages in apache james trunk project (in
unit test and in spring container).
The Query works just fine.
8923 WARN [main] openjpa.Runtime - Supplied user parameters "[domain, user]" do not match expected parameters "[]" for the prepared query "PreparedQuery: [SELECT vut FROM JamesVirtualUserTable vut WHERE (vut.user LIKE :use
vut.domain DESC] --> [SELECT t0.DOMAIN, t0.USER0, t0.TARGET_ADDRESS FROM VIRTUALUSERTABLE t0 WHERE ((t0.USER0 LIKE ? ESCAPE '\' OR t0.USER0 = ?) AND (t0.DOMAIN LIKE ? ESCAPE '\' OR t0.DOMAIN = ?)) ORDER BY t0.DOMAIN DESC]".
8939 TRACE [main] openjpa.jdbc.SQL -<t 958922509, conn 1153873934> executing prepstmnt 563165009
Should we worry about this ?
Is there a JIRA we can refer to ?
Tks,
Eric
On 18/08/2010 10:24, Harald Wellmann wrote:
> The funny thing is, it does not bomb. I turned on DEBUG logging and looked at
> the generated SQL query which is ok. I also manually ran the SQL query to
> verify the results.
>
> All this happens in the context of a web app running on Glassfish 3.0.1, and
> the problem is reproducible always within this application.
>
> I tried to isolate the effect by running the same JPQL query in my unit test
> environment where the same JPA model is used in a Java SE context, but in
> that case the warning does not occur.
>
> Let me know if there's anything I can do to pinpoint the problem.
>
> Best regards,
> Harald
>
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
Re: Strange warnings about query parameters
Posted by Pinaki Poddar <pp...@apache.org>.
> does it also affect the query execution or the result set?
I think it should bomb. Let me know what you see -- in terms of eventual SQL
query that gets executed on the database. You can switch on logging to print
SQL queries as well as their parameters.
Because of many practical complexities involved in parameter rebinding
(further complicated because we insert internal parameters as well with the
user-supplied ones), we detect few cases where we can not rebind and
automatically skip caching/reusing the target query.
The user application can also avail the facility to bypass this query
caching behavior at multiple level (for a specific query, for a subset of
queries, for a transaction, for a session etc.) [1] without completely
sacrificing the performance benefit of this reuse facility carte blanche.
[1]
http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_cache_querysql
-----
Pinaki
--
View this message in context: http://openjpa.208410.n2.nabble.com/Strange-warnings-about-query-parameters-tp5431171p5432684.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.
Re: Strange warnings about query parameters
Posted by Harald Wellmann <Ha...@multi-m.de>.
Thanks - the type of l.category is simply String.
Does the bug only lead to strange log messages, or does it also affect the
query execution or the result set?
So far I did not notice any negative effects except this message, but maybe
I just didn't look close enough...
Regards,
Harald
--
View this message in context: http://openjpa.208410.n2.nabble.com/Strange-warnings-about-query-parameters-tp5431171p5432361.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.
Re: Strange warnings about query parameters
Posted by Pinaki Poddar <pp...@apache.org>.
It's a bug.
OpenJPA translates a JPQL query Q to target SQL query S for the first
execution. Any subsequent execution of Q bypasses the SQL generation and
directly uses S. There is significant performance advantage (because Q to S
translation is quite costly). One of the key aspect of reusing the target
SQL is to rebind the query parameters -- and the rebinding path does have
known bugs.
I will take a look at your use case. What is the type of I.category?
-----
Pinaki
--
View this message in context: http://openjpa.208410.n2.nabble.com/Strange-warnings-about-query-parameters-tp5431171p5432091.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.