You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Dain Sundstrom (JIRA)" <ji...@apache.org> on 2007/02/16 02:20:05 UTC

[jira] Created: (OPENJPA-152) Warn or throw an exception when a persistence unit has multiple named queries with the same name

Warn or throw an exception when a persistence unit has multiple named queries with the same name
------------------------------------------------------------------------------------------------

                 Key: OPENJPA-152
                 URL: https://issues.apache.org/jira/browse/OPENJPA-152
             Project: OpenJPA
          Issue Type: Improvement
          Components: jpa
            Reporter: Dain Sundstrom


The JPA spec makes it quite easy for uses to create multiple named queries with the same name.  The problem stems from named queries being declared as part of an entity either via annotations or nested xml, but the name space for these queries is not scoped to the entity but scoped to the whole persistence unit.  This problem is compounded due to the ease at which the persistence unit is easily expanded with orm.xml files and with annotated beans.

I propose that we throw a deployment exception when the combined entity mapping xml files and listed classes contain multiple named queries with the same name.   If after deployment, we discover another annotate bean that creates a conflict, we should log a ERROR and take extra cautions to not override the existing in place query with the newly discovered one, as this could drastically change the behavior of an application at runtime.

Alternatively, we could just log warnings, but I would prefer a deployment exception as it guarantees I'm not running with a randomly selected set or queries.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-152) Warn or throw an exception when a persistence unit has multiple named queries with the same name

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

Patrick Linskey updated OPENJPA-152:
------------------------------------

    Component/s: query
                 logging
       Priority: Minor  (was: Major)

> Warn or throw an exception when a persistence unit has multiple named queries with the same name
> ------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-152
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-152
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: jpa, logging, query
>            Reporter: Dain Sundstrom
>            Priority: Minor
>             Fix For: 0.9.7
>
>
> The JPA spec makes it quite easy for uses to create multiple named queries with the same name.  The problem stems from named queries being declared as part of an entity either via annotations or nested xml, but the name space for these queries is not scoped to the entity but scoped to the whole persistence unit.  This problem is compounded due to the ease at which the persistence unit is easily expanded with orm.xml files and with annotated beans.
> I propose that we throw a deployment exception when the combined entity mapping xml files and listed classes contain multiple named queries with the same name.   If after deployment, we discover another annotate bean that creates a conflict, we should log a ERROR and take extra cautions to not override the existing in place query with the newly discovered one, as this could drastically change the behavior of an application at runtime.
> Alternatively, we could just log warnings, but I would prefer a deployment exception as it guarantees I'm not running with a randomly selected set or queries.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-152) Warn or throw an exception when a persistence unit has multiple named queries with the same name

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12476813 ] 

Patrick Linskey commented on OPENJPA-152:
-----------------------------------------

+1 to throwing an exception rather than logging.

> Warn or throw an exception when a persistence unit has multiple named queries with the same name
> ------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-152
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-152
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: jpa, logging, query
>            Reporter: Dain Sundstrom
>            Priority: Minor
>             Fix For: 0.9.7
>
>
> The JPA spec makes it quite easy for uses to create multiple named queries with the same name.  The problem stems from named queries being declared as part of an entity either via annotations or nested xml, but the name space for these queries is not scoped to the entity but scoped to the whole persistence unit.  This problem is compounded due to the ease at which the persistence unit is easily expanded with orm.xml files and with annotated beans.
> I propose that we throw a deployment exception when the combined entity mapping xml files and listed classes contain multiple named queries with the same name.   If after deployment, we discover another annotate bean that creates a conflict, we should log a ERROR and take extra cautions to not override the existing in place query with the newly discovered one, as this could drastically change the behavior of an application at runtime.
> Alternatively, we could just log warnings, but I would prefer a deployment exception as it guarantees I'm not running with a randomly selected set or queries.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-152) Warn or throw an exception when a persistence unit has multiple named queries with the same name

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

Patrick Linskey updated OPENJPA-152:
------------------------------------

    Fix Version/s: 0.9.7

> Warn or throw an exception when a persistence unit has multiple named queries with the same name
> ------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-152
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-152
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: jpa
>            Reporter: Dain Sundstrom
>             Fix For: 0.9.7
>
>
> The JPA spec makes it quite easy for uses to create multiple named queries with the same name.  The problem stems from named queries being declared as part of an entity either via annotations or nested xml, but the name space for these queries is not scoped to the entity but scoped to the whole persistence unit.  This problem is compounded due to the ease at which the persistence unit is easily expanded with orm.xml files and with annotated beans.
> I propose that we throw a deployment exception when the combined entity mapping xml files and listed classes contain multiple named queries with the same name.   If after deployment, we discover another annotate bean that creates a conflict, we should log a ERROR and take extra cautions to not override the existing in place query with the newly discovered one, as this could drastically change the behavior of an application at runtime.
> Alternatively, we could just log warnings, but I would prefer a deployment exception as it guarantees I'm not running with a randomly selected set or queries.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.