You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Helen Xu (JIRA)" <ji...@apache.org> on 2012/11/08 18:12:13 UTC

[jira] [Created] (OPENJPA-2295) speed up query metadata lookup

Helen Xu created OPENJPA-2295:
---------------------------------

             Summary: speed up query metadata lookup
                 Key: OPENJPA-2295
                 URL: https://issues.apache.org/jira/browse/OPENJPA-2295
             Project: OpenJPA
          Issue Type: Bug
          Components: performance, query
            Reporter: Helen Xu
            Assignee: Helen Xu
            Priority: Minor


I noticed that it used the queryKey as the map key for metadataRepository._queries, but when it goes to look up, it always uses query name. 

I double checked the JPA Spec and OPENJPA menu, it seems only support the named query creation using query name, which means the query name should be unique in one EntityManager. It doesn't matter in which entity the query is defined. So using name as the map look up key should be good enough.

when there are two queries with the same name defined in the different entities, it will only keep the query metadata for the first loaded named query and ignore the rest plus log a warning message like this:
 WARN   [main] openjpa.MetaData - Ignoring duplicate query "X" in "class org.apache.openjpa.A". A query with the same name been already declared in "class org.apache.openjpa.B".

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (OPENJPA-2295) speed up query metadata lookup

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

Helen Xu updated OPENJPA-2295:
------------------------------

    Issue Type: New Feature  (was: Bug)
    
> speed up query metadata lookup
> ------------------------------
>
>                 Key: OPENJPA-2295
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2295
>             Project: OpenJPA
>          Issue Type: New Feature
>          Components: performance, query
>            Reporter: Helen Xu
>            Assignee: Helen Xu
>            Priority: Minor
>
> I noticed that it used the queryKey as the map key for metadataRepository._queries, but when it goes to look up, it always uses query name. 
> I double checked the JPA Spec and OPENJPA menu, it seems only support the named query creation using query name, which means the query name should be unique in one EntityManager. It doesn't matter in which entity the query is defined. So using name as the map look up key should be good enough.
> when there are two queries with the same name defined in the different entities, it will only keep the query metadata for the first loaded named query and ignore the rest plus log a warning message like this:
>  WARN   [main] openjpa.MetaData - Ignoring duplicate query "X" in "class org.apache.openjpa.A". A query with the same name been already declared in "class org.apache.openjpa.B".

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (OPENJPA-2295) speed up query metadata lookup

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

Helen Xu updated OPENJPA-2295:
------------------------------

    Description: 
I noticed right now the queryKey is used as the map key for metadataRepository._queries, but when it goes to look up, it always uses query name. The query metadata lookup would be faster if we switch to query name as the key.

I double checked the JPA Spec and OPENJPA menu, it seems only support the named query creation using query name, which means the query name should be unique in one EntityManager. It doesn't matter in which entity the query is defined. So using name as the map look up key should be good enough.

when there are two queries with the same name defined in the different entities, it will only keep the query metadata for the first loaded named query and ignore the rest plus log a warning message like this:
 WARN   [main] openjpa.MetaData - Ignoring duplicate query "X" in "class org.apache.openjpa.A". A query with the same name been already declared in "class org.apache.openjpa.B".

  was:
I noticed that it used the queryKey as the map key for metadataRepository._queries, but when it goes to look up, it always uses query name. 

I double checked the JPA Spec and OPENJPA menu, it seems only support the named query creation using query name, which means the query name should be unique in one EntityManager. It doesn't matter in which entity the query is defined. So using name as the map look up key should be good enough.

when there are two queries with the same name defined in the different entities, it will only keep the query metadata for the first loaded named query and ignore the rest plus log a warning message like this:
 WARN   [main] openjpa.MetaData - Ignoring duplicate query "X" in "class org.apache.openjpa.A". A query with the same name been already declared in "class org.apache.openjpa.B".

    
> speed up query metadata lookup
> ------------------------------
>
>                 Key: OPENJPA-2295
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2295
>             Project: OpenJPA
>          Issue Type: New Feature
>          Components: performance, query
>            Reporter: Helen Xu
>            Assignee: Helen Xu
>            Priority: Minor
>         Attachments: OPENJPA-2295.patch
>
>
> I noticed right now the queryKey is used as the map key for metadataRepository._queries, but when it goes to look up, it always uses query name. The query metadata lookup would be faster if we switch to query name as the key.
> I double checked the JPA Spec and OPENJPA menu, it seems only support the named query creation using query name, which means the query name should be unique in one EntityManager. It doesn't matter in which entity the query is defined. So using name as the map look up key should be good enough.
> when there are two queries with the same name defined in the different entities, it will only keep the query metadata for the first loaded named query and ignore the rest plus log a warning message like this:
>  WARN   [main] openjpa.MetaData - Ignoring duplicate query "X" in "class org.apache.openjpa.A". A query with the same name been already declared in "class org.apache.openjpa.B".

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (OPENJPA-2295) speed up query metadata lookup

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

Helen Xu updated OPENJPA-2295:
------------------------------

    Fix Version/s: 2.2.2
                   2.3.0
    
> speed up query metadata lookup
> ------------------------------
>
>                 Key: OPENJPA-2295
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2295
>             Project: OpenJPA
>          Issue Type: New Feature
>          Components: performance, query
>    Affects Versions: 2.2.0, 2.3.0
>            Reporter: Helen Xu
>            Assignee: Helen Xu
>            Priority: Minor
>             Fix For: 2.3.0, 2.2.2
>
>         Attachments: OPENJPA-2295.patch
>
>
> I noticed right now the queryKey is used as the map key for metadataRepository._queries, but when it goes to look up, it always uses query name. The query metadata lookup would be faster if we switch to query name as the key.
> I double checked the JPA Spec and OPENJPA menu, it seems only support the named query creation using query name, which means the query name should be unique in one EntityManager. It doesn't matter in which entity the query is defined. So using name as the map look up key should be good enough.
> when there are two queries with the same name defined in the different entities, it will only keep the query metadata for the first loaded named query and ignore the rest plus log a warning message like this:
>  WARN   [main] openjpa.MetaData - Ignoring duplicate query "X" in "class org.apache.openjpa.A". A query with the same name been already declared in "class org.apache.openjpa.B".

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (OPENJPA-2295) speed up query metadata lookup

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

Helen Xu updated OPENJPA-2295:
------------------------------

    Attachment: OPENJPA-2295.patch
    
> speed up query metadata lookup
> ------------------------------
>
>                 Key: OPENJPA-2295
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2295
>             Project: OpenJPA
>          Issue Type: New Feature
>          Components: performance, query
>            Reporter: Helen Xu
>            Assignee: Helen Xu
>            Priority: Minor
>         Attachments: OPENJPA-2295.patch
>
>
> I noticed that it used the queryKey as the map key for metadataRepository._queries, but when it goes to look up, it always uses query name. 
> I double checked the JPA Spec and OPENJPA menu, it seems only support the named query creation using query name, which means the query name should be unique in one EntityManager. It doesn't matter in which entity the query is defined. So using name as the map look up key should be good enough.
> when there are two queries with the same name defined in the different entities, it will only keep the query metadata for the first loaded named query and ignore the rest plus log a warning message like this:
>  WARN   [main] openjpa.MetaData - Ignoring duplicate query "X" in "class org.apache.openjpa.A". A query with the same name been already declared in "class org.apache.openjpa.B".

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (OPENJPA-2295) speed up query metadata lookup

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

Helen Xu updated OPENJPA-2295:
------------------------------

    Affects Version/s: 2.3.0
                       2.2.0
    
> speed up query metadata lookup
> ------------------------------
>
>                 Key: OPENJPA-2295
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2295
>             Project: OpenJPA
>          Issue Type: New Feature
>          Components: performance, query
>    Affects Versions: 2.2.0, 2.3.0
>            Reporter: Helen Xu
>            Assignee: Helen Xu
>            Priority: Minor
>         Attachments: OPENJPA-2295.patch
>
>
> I noticed right now the queryKey is used as the map key for metadataRepository._queries, but when it goes to look up, it always uses query name. The query metadata lookup would be faster if we switch to query name as the key.
> I double checked the JPA Spec and OPENJPA menu, it seems only support the named query creation using query name, which means the query name should be unique in one EntityManager. It doesn't matter in which entity the query is defined. So using name as the map look up key should be good enough.
> when there are two queries with the same name defined in the different entities, it will only keep the query metadata for the first loaded named query and ignore the rest plus log a warning message like this:
>  WARN   [main] openjpa.MetaData - Ignoring duplicate query "X" in "class org.apache.openjpa.A". A query with the same name been already declared in "class org.apache.openjpa.B".

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (OPENJPA-2295) speed up query metadata lookup

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

Helen Xu resolved OPENJPA-2295.
-------------------------------

    Resolution: Fixed
    
> speed up query metadata lookup
> ------------------------------
>
>                 Key: OPENJPA-2295
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2295
>             Project: OpenJPA
>          Issue Type: New Feature
>          Components: performance, query
>    Affects Versions: 2.2.0, 2.3.0
>            Reporter: Helen Xu
>            Assignee: Helen Xu
>            Priority: Minor
>             Fix For: 2.3.0, 2.2.2
>
>         Attachments: OPENJPA-2295.patch
>
>
> I noticed right now the queryKey is used as the map key for metadataRepository._queries, but when it goes to look up, it always uses query name. The query metadata lookup would be faster if we switch to query name as the key.
> I double checked the JPA Spec and OPENJPA menu, it seems only support the named query creation using query name, which means the query name should be unique in one EntityManager. It doesn't matter in which entity the query is defined. So using name as the map look up key should be good enough.
> when there are two queries with the same name defined in the different entities, it will only keep the query metadata for the first loaded named query and ignore the rest plus log a warning message like this:
>  WARN   [main] openjpa.MetaData - Ignoring duplicate query "X" in "class org.apache.openjpa.A". A query with the same name been already declared in "class org.apache.openjpa.B".

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira