You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Ognjen Blagojevic (JIRA)" <ji...@apache.org> on 2011/06/13 19:18:51 UTC

[jira] [Created] (OPENJPA-2016) OpenJPA sometimes incorrectly complains about wrong number of parameters

OpenJPA sometimes incorrectly complains about wrong number of parameters
------------------------------------------------------------------------

                 Key: OPENJPA-2016
                 URL: https://issues.apache.org/jira/browse/OPENJPA-2016
             Project: OpenJPA
          Issue Type: Bug
    Affects Versions: 2.1.0, 2.2.0
         Environment: Windows XP, Sun JDK 1.6.0_24, Maven 2.2.1
            Reporter: Ognjen Blagojevic


OpenJPA sometimes incorrectly complains about wrong number of parameters, e.g.:

"47  test  WARN   [main] openjpa.Runtime - Supplied user parameters "[name, nameDiscriminator]" do not match expected parameters "[name]" for the prepared query "PreparedQuery: [SELECT o FROM simple o WHERE ((:nameDiscriminator=false) OR (o.name = :name))] --> [SELECT t0.ID, t0.NAME, t0.VALUE FROM SIMPLE_ENTITY t0 WHERE (1=0 OR t0.NAME = ?)]".

I will add the patch to demonstrate the behavior. Run test at openjpa-persistence-jdbc, e.g:

mvn -Dtest=TestQueryParameters test-compile test

The query is intentionally executed twice, since only second execution yields warning message.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OPENJPA-2016) OpenJPA sometimes incorrectly complains about wrong number of parameters

Posted by "Ognjen Blagojevic (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-2016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13052261#comment-13052261 ] 

Ognjen Blagojevic commented on OPENJPA-2016:
--------------------------------------------

Hi,

Could anyone confirm this issue, please?

> OpenJPA sometimes incorrectly complains about wrong number of parameters
> ------------------------------------------------------------------------
>
>                 Key: OPENJPA-2016
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2016
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.1.0, 2.2.0
>         Environment: Windows XP, Sun JDK 1.6.0_24, Maven 2.2.1
>            Reporter: Ognjen Blagojevic
>         Attachments: discriminatorParameter.patch
>
>
> OpenJPA sometimes incorrectly complains about wrong number of parameters, e.g.:
> "47  test  WARN   [main] openjpa.Runtime - Supplied user parameters "[name, nameDiscriminator]" do not match expected parameters "[name]" for the prepared query "PreparedQuery: [SELECT o FROM simple o WHERE ((:nameDiscriminator=false) OR (o.name = :name))] --> [SELECT t0.ID, t0.NAME, t0.VALUE FROM SIMPLE_ENTITY t0 WHERE (1=0 OR t0.NAME = ?)]".
> I will add the patch to demonstrate the behavior. Run test at openjpa-persistence-jdbc, e.g:
> mvn -Dtest=TestQueryParameters test-compile test
> The query is intentionally executed twice, since only second execution yields warning message.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OPENJPA-2016) OpenJPA sometimes incorrectly complains about wrong number of parameters

Posted by "Rick Curtis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-2016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13052824#comment-13052824 ] 

Rick Curtis commented on OPENJPA-2016:
--------------------------------------

I applied your patch, and yes we do incorrectly log a warning message. 

It appears to function properly though?

> OpenJPA sometimes incorrectly complains about wrong number of parameters
> ------------------------------------------------------------------------
>
>                 Key: OPENJPA-2016
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2016
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.1.0, 2.2.0
>         Environment: Windows XP, Sun JDK 1.6.0_24, Maven 2.2.1
>            Reporter: Ognjen Blagojevic
>         Attachments: discriminatorParameter.patch
>
>
> OpenJPA sometimes incorrectly complains about wrong number of parameters, e.g.:
> "47  test  WARN   [main] openjpa.Runtime - Supplied user parameters "[name, nameDiscriminator]" do not match expected parameters "[name]" for the prepared query "PreparedQuery: [SELECT o FROM simple o WHERE ((:nameDiscriminator=false) OR (o.name = :name))] --> [SELECT t0.ID, t0.NAME, t0.VALUE FROM SIMPLE_ENTITY t0 WHERE (1=0 OR t0.NAME = ?)]".
> I will add the patch to demonstrate the behavior. Run test at openjpa-persistence-jdbc, e.g:
> mvn -Dtest=TestQueryParameters test-compile test
> The query is intentionally executed twice, since only second execution yields warning message.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (OPENJPA-2016) OpenJPA sometimes incorrectly complains about wrong number of parameters

Posted by "Ognjen Blagojevic (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-2016?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ognjen Blagojevic updated OPENJPA-2016:
---------------------------------------

    Attachment: discriminatorParameter.patch

> OpenJPA sometimes incorrectly complains about wrong number of parameters
> ------------------------------------------------------------------------
>
>                 Key: OPENJPA-2016
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2016
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.1.0, 2.2.0
>         Environment: Windows XP, Sun JDK 1.6.0_24, Maven 2.2.1
>            Reporter: Ognjen Blagojevic
>         Attachments: discriminatorParameter.patch
>
>
> OpenJPA sometimes incorrectly complains about wrong number of parameters, e.g.:
> "47  test  WARN   [main] openjpa.Runtime - Supplied user parameters "[name, nameDiscriminator]" do not match expected parameters "[name]" for the prepared query "PreparedQuery: [SELECT o FROM simple o WHERE ((:nameDiscriminator=false) OR (o.name = :name))] --> [SELECT t0.ID, t0.NAME, t0.VALUE FROM SIMPLE_ENTITY t0 WHERE (1=0 OR t0.NAME = ?)]".
> I will add the patch to demonstrate the behavior. Run test at openjpa-persistence-jdbc, e.g:
> mvn -Dtest=TestQueryParameters test-compile test
> The query is intentionally executed twice, since only second execution yields warning message.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OPENJPA-2016) OpenJPA sometimes incorrectly complains about wrong number of parameters

Posted by "Ognjen Blagojevic (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-2016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13053270#comment-13053270 ] 

Ognjen Blagojevic commented on OPENJPA-2016:
--------------------------------------------

Query executes fine, it is just the problem with the log messages (which heavily burden my log files).

> OpenJPA sometimes incorrectly complains about wrong number of parameters
> ------------------------------------------------------------------------
>
>                 Key: OPENJPA-2016
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2016
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.1.0, 2.2.0
>         Environment: Windows XP, Sun JDK 1.6.0_24, Maven 2.2.1
>            Reporter: Ognjen Blagojevic
>         Attachments: discriminatorParameter.patch
>
>
> OpenJPA sometimes incorrectly complains about wrong number of parameters, e.g.:
> "47  test  WARN   [main] openjpa.Runtime - Supplied user parameters "[name, nameDiscriminator]" do not match expected parameters "[name]" for the prepared query "PreparedQuery: [SELECT o FROM simple o WHERE ((:nameDiscriminator=false) OR (o.name = :name))] --> [SELECT t0.ID, t0.NAME, t0.VALUE FROM SIMPLE_ENTITY t0 WHERE (1=0 OR t0.NAME = ?)]".
> I will add the patch to demonstrate the behavior. Run test at openjpa-persistence-jdbc, e.g:
> mvn -Dtest=TestQueryParameters test-compile test
> The query is intentionally executed twice, since only second execution yields warning message.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OPENJPA-2016) OpenJPA sometimes incorrectly complains about wrong number of parameters

Posted by "Pinaki Poddar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-2016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13048783#comment-13048783 ] 

Pinaki Poddar commented on OPENJPA-2016:
----------------------------------------

>From the patch,
> +        String jpql = "SELECT o FROM simple o WHERE ((:nameDiscriminator=false) OR (o.name = :name))";

a) 'simple' is not an entity name -- or do you mean 'SimpleEntity'?
b)  (:nameDiscriminator=false) -- that is interesting.  The binding parameters occur in right side of a predicate (generally) 

Did you get this query executed, for the first time at least? 



> OpenJPA sometimes incorrectly complains about wrong number of parameters
> ------------------------------------------------------------------------
>
>                 Key: OPENJPA-2016
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2016
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.1.0, 2.2.0
>         Environment: Windows XP, Sun JDK 1.6.0_24, Maven 2.2.1
>            Reporter: Ognjen Blagojevic
>         Attachments: discriminatorParameter.patch
>
>
> OpenJPA sometimes incorrectly complains about wrong number of parameters, e.g.:
> "47  test  WARN   [main] openjpa.Runtime - Supplied user parameters "[name, nameDiscriminator]" do not match expected parameters "[name]" for the prepared query "PreparedQuery: [SELECT o FROM simple o WHERE ((:nameDiscriminator=false) OR (o.name = :name))] --> [SELECT t0.ID, t0.NAME, t0.VALUE FROM SIMPLE_ENTITY t0 WHERE (1=0 OR t0.NAME = ?)]".
> I will add the patch to demonstrate the behavior. Run test at openjpa-persistence-jdbc, e.g:
> mvn -Dtest=TestQueryParameters test-compile test
> The query is intentionally executed twice, since only second execution yields warning message.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OPENJPA-2016) OpenJPA sometimes incorrectly complains about wrong number of parameters

Posted by "Ognjen Blagojevic (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-2016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13049111#comment-13049111 ] 

Ognjen Blagojevic commented on OPENJPA-2016:
--------------------------------------------

Yes, query is executed both times.

a) "simple" is the name of the entity for class SimpleEntity. Please look at SimpleEntity.java:

@Entity(name = "simple")
@Table(name = "SIMPLE_ENTITY")
public class SimpleEntity implements Serializable {
...

In the mentioned test class (TestQueryParameters.java) there are similar queries ("select e from simple e...").


b) I also tested with the binding parameter on the right side, but the result is the same:

172  test  WARN   [main] openjpa.Runtime - Supplied user parameters "[name, nameDiscriminator]" do not match expected parameters "[name]" for the prepared query "PreparedQuery: [SELECT o FROM simple o WHERE ((false = :nameDiscriminator) OR (o.name = :name))] --> [SELECT t0.ID, t0.NAME, t0.VALUE FROM  SIMPLE_ENTITY t0 WHERE (0=1 OR t0.NAME = ?)]".



> OpenJPA sometimes incorrectly complains about wrong number of parameters
> ------------------------------------------------------------------------
>
>                 Key: OPENJPA-2016
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2016
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.1.0, 2.2.0
>         Environment: Windows XP, Sun JDK 1.6.0_24, Maven 2.2.1
>            Reporter: Ognjen Blagojevic
>         Attachments: discriminatorParameter.patch
>
>
> OpenJPA sometimes incorrectly complains about wrong number of parameters, e.g.:
> "47  test  WARN   [main] openjpa.Runtime - Supplied user parameters "[name, nameDiscriminator]" do not match expected parameters "[name]" for the prepared query "PreparedQuery: [SELECT o FROM simple o WHERE ((:nameDiscriminator=false) OR (o.name = :name))] --> [SELECT t0.ID, t0.NAME, t0.VALUE FROM SIMPLE_ENTITY t0 WHERE (1=0 OR t0.NAME = ?)]".
> I will add the patch to demonstrate the behavior. Run test at openjpa-persistence-jdbc, e.g:
> mvn -Dtest=TestQueryParameters test-compile test
> The query is intentionally executed twice, since only second execution yields warning message.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira