You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Fay Wang (JIRA)" <ji...@apache.org> on 2010/01/15 00:30:54 UTC

[jira] Created: (OPENJPA-1460) Fix scope visibility of orm.xml when it is packaged in both ear file and war file

Fix scope visibility of orm.xml when it is packaged in both ear file and war file
---------------------------------------------------------------------------------

                 Key: OPENJPA-1460
                 URL: https://issues.apache.org/jira/browse/OPENJPA-1460
             Project: OpenJPA
          Issue Type: Bug
    Affects Versions: 2.0.0
            Reporter: Fay Wang
            Assignee: Fay Wang
             Fix For: 2.0.0


Per JPA 2.0 spec, section 8.2.2:
An EJB-JAR, WAR, application client jar, or EAR can define a persistence unit. When referencing a persistence unit using the unitName annotation element or persistence-unit-name deployment descriptor element, the visibility scope of the persistence unit is determined by its point of definition:

(1) A persistence unit that is defined at the level of an EJB-JAR, WAR, or application client jar is scoped to that EJB-JAR, WAR, or application jar respectively and is visible to the components defined in that jar or war.

(2) A persistence unit that is defined at the level of the EAR is generally visible to all components in the application. However, if a persistence unit of the same name is defined by an EJB-JAR, WAR, or application jar file within the EAR, the persistence unit of that name defined at EAR level will not be visible to the components defined by that EJB-JAR, WAR, or application jar file unless the persistence unit reference uses the persistence unit name # syntax to specify a path name to disambiguate the reference. When the # syntax is used, the path name is relative to the referencing application component jar file. For example, the syntax ../lib/persistenceUnitRoot. jar#myPersistenceUnit refers to a persistence unit whose name, as specified in the name element of the persistence.xml file, is myPersistenceUnit and for which the relative path name of the root of the persistence unit is ../lib/persistenceUnitRoot. jar. The # syntax may be used with both the unitName annotation 
 element
or persistence-unit-name deployment descriptor element to reference a persistence unit defined at EAR level.


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


[jira] Updated: (OPENJPA-1460) Fix scope visibility of orm.xml when it is packaged in both ear file and war file

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

Donald Woods updated OPENJPA-1460:
----------------------------------

    Component/s: jpa
       Assignee: Donald Woods  (was: Fay Wang)

> Fix scope visibility of orm.xml when it is packaged in both ear file and war file
> ---------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1460
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1460
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.0.0-M3, 2.0.0-beta
>            Reporter: Fay Wang
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-1460-1.patch, OPENJPA-1460-2.patch, OPENJPA-1460-3.patch, OPENJPA-1460.patch
>
>
> Per JPA 2.0 spec, section 8.2.2:
> An EJB-JAR, WAR, application client jar, or EAR can define a persistence unit. When referencing a persistence unit using the unitName annotation element or persistence-unit-name deployment descriptor element, the visibility scope of the persistence unit is determined by its point of definition:
> (1) A persistence unit that is defined at the level of an EJB-JAR, WAR, or application client jar is scoped to that EJB-JAR, WAR, or application jar respectively and is visible to the components defined in that jar or war.
> (2) A persistence unit that is defined at the level of the EAR is generally visible to all components in the application. However, if a persistence unit of the same name is defined by an EJB-JAR, WAR, or application jar file within the EAR, the persistence unit of that name defined at EAR level will not be visible to the components defined by that EJB-JAR, WAR, or application jar file unless the persistence unit reference uses the persistence unit name # syntax to specify a path name to disambiguate the reference. When the # syntax is used, the path name is relative to the referencing application component jar file. For example, the syntax ../lib/persistenceUnitRoot. jar#myPersistenceUnit refers to a persistence unit whose name, as specified in the name element of the persistence.xml file, is myPersistenceUnit and for which the relative path name of the root of the persistence unit is ../lib/persistenceUnitRoot. jar. The # syntax may be used with both the unitName annotation element
> or persistence-unit-name deployment descriptor element to reference a persistence unit defined at EAR level.

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


[jira] Updated: (OPENJPA-1460) Fix scope visibility of orm.xml when it is packaged in both ear file and war file

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

Fay Wang updated OPENJPA-1460:
------------------------------

    Attachment: OPENJPA-1460-1.patch

fix NPE.

> Fix scope visibility of orm.xml when it is packaged in both ear file and war file
> ---------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1460
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1460
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Fay Wang
>            Assignee: Fay Wang
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-1460-1.patch, OPENJPA-1460.patch
>
>
> Per JPA 2.0 spec, section 8.2.2:
> An EJB-JAR, WAR, application client jar, or EAR can define a persistence unit. When referencing a persistence unit using the unitName annotation element or persistence-unit-name deployment descriptor element, the visibility scope of the persistence unit is determined by its point of definition:
> (1) A persistence unit that is defined at the level of an EJB-JAR, WAR, or application client jar is scoped to that EJB-JAR, WAR, or application jar respectively and is visible to the components defined in that jar or war.
> (2) A persistence unit that is defined at the level of the EAR is generally visible to all components in the application. However, if a persistence unit of the same name is defined by an EJB-JAR, WAR, or application jar file within the EAR, the persistence unit of that name defined at EAR level will not be visible to the components defined by that EJB-JAR, WAR, or application jar file unless the persistence unit reference uses the persistence unit name # syntax to specify a path name to disambiguate the reference. When the # syntax is used, the path name is relative to the referencing application component jar file. For example, the syntax ../lib/persistenceUnitRoot. jar#myPersistenceUnit refers to a persistence unit whose name, as specified in the name element of the persistence.xml file, is myPersistenceUnit and for which the relative path name of the root of the persistence unit is ../lib/persistenceUnitRoot. jar. The # syntax may be used with both the unitName annotation element
> or persistence-unit-name deployment descriptor element to reference a persistence unit defined at EAR level.

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


[jira] Resolved: (OPENJPA-1460) Fix scope visibility of orm.xml when it is packaged in both ear file and war file

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

Donald Woods resolved OPENJPA-1460.
-----------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 2.0.0)
                   2.0.0-beta2

all patches were applied and included in Beta2, so closing this.  there is a open subtask for remaining optional work.

> Fix scope visibility of orm.xml when it is packaged in both ear file and war file
> ---------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1460
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1460
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.0.0-M3, 2.0.0-beta
>            Reporter: Fay Wang
>            Assignee: Fay Wang
>             Fix For: 2.0.0-beta2
>
>         Attachments: OPENJPA-1460-1.patch, OPENJPA-1460-2.patch, OPENJPA-1460-3.patch, OPENJPA-1460-4.patch, OPENJPA-1460-5.patch, OPENJPA-1460.patch
>
>
> Per JPA 2.0 spec, section 8.2.2:
> An EJB-JAR, WAR, application client jar, or EAR can define a persistence unit. When referencing a persistence unit using the unitName annotation element or persistence-unit-name deployment descriptor element, the visibility scope of the persistence unit is determined by its point of definition:
> (1) A persistence unit that is defined at the level of an EJB-JAR, WAR, or application client jar is scoped to that EJB-JAR, WAR, or application jar respectively and is visible to the components defined in that jar or war.
> (2) A persistence unit that is defined at the level of the EAR is generally visible to all components in the application. However, if a persistence unit of the same name is defined by an EJB-JAR, WAR, or application jar file within the EAR, the persistence unit of that name defined at EAR level will not be visible to the components defined by that EJB-JAR, WAR, or application jar file unless the persistence unit reference uses the persistence unit name # syntax to specify a path name to disambiguate the reference. When the # syntax is used, the path name is relative to the referencing application component jar file. For example, the syntax ../lib/persistenceUnitRoot. jar#myPersistenceUnit refers to a persistence unit whose name, as specified in the name element of the persistence.xml file, is myPersistenceUnit and for which the relative path name of the root of the persistence unit is ../lib/persistenceUnitRoot. jar. The # syntax may be used with both the unitName annotation element
> or persistence-unit-name deployment descriptor element to reference a persistence unit defined at EAR level.

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


[jira] Commented: (OPENJPA-1460) Fix scope visibility of orm.xml when it is packaged in both ear file and war file

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

Fay Wang commented on OPENJPA-1460:
-----------------------------------

The fix checked into the JIRA assume that the orm.xml to be used should reside in the same location as the persistence.xml that is used to create EntityManagerFactory.

> Fix scope visibility of orm.xml when it is packaged in both ear file and war file
> ---------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1460
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1460
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Fay Wang
>            Assignee: Fay Wang
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-1460-1.patch, OPENJPA-1460.patch
>
>
> Per JPA 2.0 spec, section 8.2.2:
> An EJB-JAR, WAR, application client jar, or EAR can define a persistence unit. When referencing a persistence unit using the unitName annotation element or persistence-unit-name deployment descriptor element, the visibility scope of the persistence unit is determined by its point of definition:
> (1) A persistence unit that is defined at the level of an EJB-JAR, WAR, or application client jar is scoped to that EJB-JAR, WAR, or application jar respectively and is visible to the components defined in that jar or war.
> (2) A persistence unit that is defined at the level of the EAR is generally visible to all components in the application. However, if a persistence unit of the same name is defined by an EJB-JAR, WAR, or application jar file within the EAR, the persistence unit of that name defined at EAR level will not be visible to the components defined by that EJB-JAR, WAR, or application jar file unless the persistence unit reference uses the persistence unit name # syntax to specify a path name to disambiguate the reference. When the # syntax is used, the path name is relative to the referencing application component jar file. For example, the syntax ../lib/persistenceUnitRoot. jar#myPersistenceUnit refers to a persistence unit whose name, as specified in the name element of the persistence.xml file, is myPersistenceUnit and for which the relative path name of the root of the persistence unit is ../lib/persistenceUnitRoot. jar. The # syntax may be used with both the unitName annotation element
> or persistence-unit-name deployment descriptor element to reference a persistence unit defined at EAR level.

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


[jira] Assigned: (OPENJPA-1460) Fix scope visibility of orm.xml when it is packaged in both ear file and war file

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

Donald Woods reassigned OPENJPA-1460:
-------------------------------------

    Assignee: Fay Wang  (was: Donald Woods)

Fay, why did you reopen this?  Is there more work or docs updates to do?


> Fix scope visibility of orm.xml when it is packaged in both ear file and war file
> ---------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1460
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1460
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.0.0-M3, 2.0.0-beta
>            Reporter: Fay Wang
>            Assignee: Fay Wang
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-1460-1.patch, OPENJPA-1460-2.patch, OPENJPA-1460-3.patch, OPENJPA-1460-4.patch, OPENJPA-1460-5.patch, OPENJPA-1460.patch
>
>
> Per JPA 2.0 spec, section 8.2.2:
> An EJB-JAR, WAR, application client jar, or EAR can define a persistence unit. When referencing a persistence unit using the unitName annotation element or persistence-unit-name deployment descriptor element, the visibility scope of the persistence unit is determined by its point of definition:
> (1) A persistence unit that is defined at the level of an EJB-JAR, WAR, or application client jar is scoped to that EJB-JAR, WAR, or application jar respectively and is visible to the components defined in that jar or war.
> (2) A persistence unit that is defined at the level of the EAR is generally visible to all components in the application. However, if a persistence unit of the same name is defined by an EJB-JAR, WAR, or application jar file within the EAR, the persistence unit of that name defined at EAR level will not be visible to the components defined by that EJB-JAR, WAR, or application jar file unless the persistence unit reference uses the persistence unit name # syntax to specify a path name to disambiguate the reference. When the # syntax is used, the path name is relative to the referencing application component jar file. For example, the syntax ../lib/persistenceUnitRoot. jar#myPersistenceUnit refers to a persistence unit whose name, as specified in the name element of the persistence.xml file, is myPersistenceUnit and for which the relative path name of the root of the persistence unit is ../lib/persistenceUnitRoot. jar. The # syntax may be used with both the unitName annotation element
> or persistence-unit-name deployment descriptor element to reference a persistence unit defined at EAR level.

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


[jira] Updated: (OPENJPA-1460) Fix scope visibility of orm.xml when it is packaged in both ear file and war file

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

Donald Woods updated OPENJPA-1460:
----------------------------------

           Patch Info: [Patch Available]
    Affects Version/s:     (was: 2.0.0)
                       2.0.0-M3
                       2.0.0-beta

> Fix scope visibility of orm.xml when it is packaged in both ear file and war file
> ---------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1460
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1460
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.0.0-M3, 2.0.0-beta
>            Reporter: Fay Wang
>            Assignee: Fay Wang
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-1460-1.patch, OPENJPA-1460-2.patch, OPENJPA-1460-3.patch, OPENJPA-1460.patch
>
>
> Per JPA 2.0 spec, section 8.2.2:
> An EJB-JAR, WAR, application client jar, or EAR can define a persistence unit. When referencing a persistence unit using the unitName annotation element or persistence-unit-name deployment descriptor element, the visibility scope of the persistence unit is determined by its point of definition:
> (1) A persistence unit that is defined at the level of an EJB-JAR, WAR, or application client jar is scoped to that EJB-JAR, WAR, or application jar respectively and is visible to the components defined in that jar or war.
> (2) A persistence unit that is defined at the level of the EAR is generally visible to all components in the application. However, if a persistence unit of the same name is defined by an EJB-JAR, WAR, or application jar file within the EAR, the persistence unit of that name defined at EAR level will not be visible to the components defined by that EJB-JAR, WAR, or application jar file unless the persistence unit reference uses the persistence unit name # syntax to specify a path name to disambiguate the reference. When the # syntax is used, the path name is relative to the referencing application component jar file. For example, the syntax ../lib/persistenceUnitRoot. jar#myPersistenceUnit refers to a persistence unit whose name, as specified in the name element of the persistence.xml file, is myPersistenceUnit and for which the relative path name of the root of the persistence unit is ../lib/persistenceUnitRoot. jar. The # syntax may be used with both the unitName annotation element
> or persistence-unit-name deployment descriptor element to reference a persistence unit defined at EAR level.

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


[jira] Commented: (OPENJPA-1460) Fix scope visibility of orm.xml when it is packaged in both ear file and war file

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

Fay Wang commented on OPENJPA-1460:
-----------------------------------

Per spec:
8.2.1.6.2 Object/relational Mapping Files
A object/relational mapping XML file named orm.xml may be specified in the META-INF directory in the root of the persistence unit or in the META-INF directory of any jar file referenced by the persistence.xml. Alternatively, or in addition, one or more mapping files may be referenced by the mapping-file elements of the persistence-unit element. These mapping files may be present anywhere on the class path.

As a result: 
the entity manager factory will look look for orm.xml file 	
	1.  in the same location (jar file\meta-inf directory) as where the persistence.xml that defined the pu of the EMF was found.
	2.  in the meta-inf directory of any jar file explicitly mentioned in the <jarfile> tag in the PU.

finally any <mapping-file> files are also loaded.  






> Fix scope visibility of orm.xml when it is packaged in both ear file and war file
> ---------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1460
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1460
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Fay Wang
>            Assignee: Fay Wang
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-1460-1.patch, OPENJPA-1460-2.patch, OPENJPA-1460.patch
>
>
> Per JPA 2.0 spec, section 8.2.2:
> An EJB-JAR, WAR, application client jar, or EAR can define a persistence unit. When referencing a persistence unit using the unitName annotation element or persistence-unit-name deployment descriptor element, the visibility scope of the persistence unit is determined by its point of definition:
> (1) A persistence unit that is defined at the level of an EJB-JAR, WAR, or application client jar is scoped to that EJB-JAR, WAR, or application jar respectively and is visible to the components defined in that jar or war.
> (2) A persistence unit that is defined at the level of the EAR is generally visible to all components in the application. However, if a persistence unit of the same name is defined by an EJB-JAR, WAR, or application jar file within the EAR, the persistence unit of that name defined at EAR level will not be visible to the components defined by that EJB-JAR, WAR, or application jar file unless the persistence unit reference uses the persistence unit name # syntax to specify a path name to disambiguate the reference. When the # syntax is used, the path name is relative to the referencing application component jar file. For example, the syntax ../lib/persistenceUnitRoot. jar#myPersistenceUnit refers to a persistence unit whose name, as specified in the name element of the persistence.xml file, is myPersistenceUnit and for which the relative path name of the root of the persistence unit is ../lib/persistenceUnitRoot. jar. The # syntax may be used with both the unitName annotation element
> or persistence-unit-name deployment descriptor element to reference a persistence unit defined at EAR level.

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


[jira] Updated: (OPENJPA-1460) Fix scope visibility of orm.xml when it is packaged in both ear file and war file

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

Fay Wang updated OPENJPA-1460:
------------------------------

    Attachment: OPENJPA-1460.patch

> Fix scope visibility of orm.xml when it is packaged in both ear file and war file
> ---------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1460
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1460
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Fay Wang
>            Assignee: Fay Wang
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-1460.patch
>
>
> Per JPA 2.0 spec, section 8.2.2:
> An EJB-JAR, WAR, application client jar, or EAR can define a persistence unit. When referencing a persistence unit using the unitName annotation element or persistence-unit-name deployment descriptor element, the visibility scope of the persistence unit is determined by its point of definition:
> (1) A persistence unit that is defined at the level of an EJB-JAR, WAR, or application client jar is scoped to that EJB-JAR, WAR, or application jar respectively and is visible to the components defined in that jar or war.
> (2) A persistence unit that is defined at the level of the EAR is generally visible to all components in the application. However, if a persistence unit of the same name is defined by an EJB-JAR, WAR, or application jar file within the EAR, the persistence unit of that name defined at EAR level will not be visible to the components defined by that EJB-JAR, WAR, or application jar file unless the persistence unit reference uses the persistence unit name # syntax to specify a path name to disambiguate the reference. When the # syntax is used, the path name is relative to the referencing application component jar file. For example, the syntax ../lib/persistenceUnitRoot. jar#myPersistenceUnit refers to a persistence unit whose name, as specified in the name element of the persistence.xml file, is myPersistenceUnit and for which the relative path name of the root of the persistence unit is ../lib/persistenceUnitRoot. jar. The # syntax may be used with both the unitName annotation element
> or persistence-unit-name deployment descriptor element to reference a persistence unit defined at EAR level.

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


[jira] Closed: (OPENJPA-1460) Fix scope visibility of orm.xml when it is packaged in both ear file and war file

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

Fay Wang closed OPENJPA-1460.
-----------------------------


> Fix scope visibility of orm.xml when it is packaged in both ear file and war file
> ---------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1460
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1460
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.0.0-M3, 2.0.0-beta
>            Reporter: Fay Wang
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-1460-1.patch, OPENJPA-1460-2.patch, OPENJPA-1460-3.patch, OPENJPA-1460-4.patch, OPENJPA-1460-5.patch, OPENJPA-1460.patch
>
>
> Per JPA 2.0 spec, section 8.2.2:
> An EJB-JAR, WAR, application client jar, or EAR can define a persistence unit. When referencing a persistence unit using the unitName annotation element or persistence-unit-name deployment descriptor element, the visibility scope of the persistence unit is determined by its point of definition:
> (1) A persistence unit that is defined at the level of an EJB-JAR, WAR, or application client jar is scoped to that EJB-JAR, WAR, or application jar respectively and is visible to the components defined in that jar or war.
> (2) A persistence unit that is defined at the level of the EAR is generally visible to all components in the application. However, if a persistence unit of the same name is defined by an EJB-JAR, WAR, or application jar file within the EAR, the persistence unit of that name defined at EAR level will not be visible to the components defined by that EJB-JAR, WAR, or application jar file unless the persistence unit reference uses the persistence unit name # syntax to specify a path name to disambiguate the reference. When the # syntax is used, the path name is relative to the referencing application component jar file. For example, the syntax ../lib/persistenceUnitRoot. jar#myPersistenceUnit refers to a persistence unit whose name, as specified in the name element of the persistence.xml file, is myPersistenceUnit and for which the relative path name of the root of the persistence unit is ../lib/persistenceUnitRoot. jar. The # syntax may be used with both the unitName annotation element
> or persistence-unit-name deployment descriptor element to reference a persistence unit defined at EAR level.

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


[jira] Updated: (OPENJPA-1460) Fix scope visibility of orm.xml when it is packaged in both ear file and war file

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

Donald Woods updated OPENJPA-1460:
----------------------------------

    Attachment: OPENJPA-1460-4.patch

Updated patch that can be applied to the latest trunk (r908071) code

> Fix scope visibility of orm.xml when it is packaged in both ear file and war file
> ---------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1460
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1460
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.0.0-M3, 2.0.0-beta
>            Reporter: Fay Wang
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-1460-1.patch, OPENJPA-1460-2.patch, OPENJPA-1460-3.patch, OPENJPA-1460-4.patch, OPENJPA-1460.patch
>
>
> Per JPA 2.0 spec, section 8.2.2:
> An EJB-JAR, WAR, application client jar, or EAR can define a persistence unit. When referencing a persistence unit using the unitName annotation element or persistence-unit-name deployment descriptor element, the visibility scope of the persistence unit is determined by its point of definition:
> (1) A persistence unit that is defined at the level of an EJB-JAR, WAR, or application client jar is scoped to that EJB-JAR, WAR, or application jar respectively and is visible to the components defined in that jar or war.
> (2) A persistence unit that is defined at the level of the EAR is generally visible to all components in the application. However, if a persistence unit of the same name is defined by an EJB-JAR, WAR, or application jar file within the EAR, the persistence unit of that name defined at EAR level will not be visible to the components defined by that EJB-JAR, WAR, or application jar file unless the persistence unit reference uses the persistence unit name # syntax to specify a path name to disambiguate the reference. When the # syntax is used, the path name is relative to the referencing application component jar file. For example, the syntax ../lib/persistenceUnitRoot. jar#myPersistenceUnit refers to a persistence unit whose name, as specified in the name element of the persistence.xml file, is myPersistenceUnit and for which the relative path name of the root of the persistence unit is ../lib/persistenceUnitRoot. jar. The # syntax may be used with both the unitName annotation element
> or persistence-unit-name deployment descriptor element to reference a persistence unit defined at EAR level.

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


[jira] Resolved: (OPENJPA-1460) Fix scope visibility of orm.xml when it is packaged in both ear file and war file

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

Fay Wang resolved OPENJPA-1460.
-------------------------------

    Resolution: Fixed

> Fix scope visibility of orm.xml when it is packaged in both ear file and war file
> ---------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1460
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1460
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.0.0-M3, 2.0.0-beta
>            Reporter: Fay Wang
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-1460-1.patch, OPENJPA-1460-2.patch, OPENJPA-1460-3.patch, OPENJPA-1460-4.patch, OPENJPA-1460-5.patch, OPENJPA-1460.patch
>
>
> Per JPA 2.0 spec, section 8.2.2:
> An EJB-JAR, WAR, application client jar, or EAR can define a persistence unit. When referencing a persistence unit using the unitName annotation element or persistence-unit-name deployment descriptor element, the visibility scope of the persistence unit is determined by its point of definition:
> (1) A persistence unit that is defined at the level of an EJB-JAR, WAR, or application client jar is scoped to that EJB-JAR, WAR, or application jar respectively and is visible to the components defined in that jar or war.
> (2) A persistence unit that is defined at the level of the EAR is generally visible to all components in the application. However, if a persistence unit of the same name is defined by an EJB-JAR, WAR, or application jar file within the EAR, the persistence unit of that name defined at EAR level will not be visible to the components defined by that EJB-JAR, WAR, or application jar file unless the persistence unit reference uses the persistence unit name # syntax to specify a path name to disambiguate the reference. When the # syntax is used, the path name is relative to the referencing application component jar file. For example, the syntax ../lib/persistenceUnitRoot. jar#myPersistenceUnit refers to a persistence unit whose name, as specified in the name element of the persistence.xml file, is myPersistenceUnit and for which the relative path name of the root of the persistence unit is ../lib/persistenceUnitRoot. jar. The # syntax may be used with both the unitName annotation element
> or persistence-unit-name deployment descriptor element to reference a persistence unit defined at EAR level.

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


[jira] Reopened: (OPENJPA-1460) Fix scope visibility of orm.xml when it is packaged in both ear file and war file

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

Fay Wang reopened OPENJPA-1460:
-------------------------------


> Fix scope visibility of orm.xml when it is packaged in both ear file and war file
> ---------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1460
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1460
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.0.0-M3, 2.0.0-beta
>            Reporter: Fay Wang
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-1460-1.patch, OPENJPA-1460-2.patch, OPENJPA-1460-3.patch, OPENJPA-1460-4.patch, OPENJPA-1460-5.patch, OPENJPA-1460.patch
>
>
> Per JPA 2.0 spec, section 8.2.2:
> An EJB-JAR, WAR, application client jar, or EAR can define a persistence unit. When referencing a persistence unit using the unitName annotation element or persistence-unit-name deployment descriptor element, the visibility scope of the persistence unit is determined by its point of definition:
> (1) A persistence unit that is defined at the level of an EJB-JAR, WAR, or application client jar is scoped to that EJB-JAR, WAR, or application jar respectively and is visible to the components defined in that jar or war.
> (2) A persistence unit that is defined at the level of the EAR is generally visible to all components in the application. However, if a persistence unit of the same name is defined by an EJB-JAR, WAR, or application jar file within the EAR, the persistence unit of that name defined at EAR level will not be visible to the components defined by that EJB-JAR, WAR, or application jar file unless the persistence unit reference uses the persistence unit name # syntax to specify a path name to disambiguate the reference. When the # syntax is used, the path name is relative to the referencing application component jar file. For example, the syntax ../lib/persistenceUnitRoot. jar#myPersistenceUnit refers to a persistence unit whose name, as specified in the name element of the persistence.xml file, is myPersistenceUnit and for which the relative path name of the root of the persistence unit is ../lib/persistenceUnitRoot. jar. The # syntax may be used with both the unitName annotation element
> or persistence-unit-name deployment descriptor element to reference a persistence unit defined at EAR level.

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


[jira] Commented: (OPENJPA-1460) Fix scope visibility of orm.xml when it is packaged in both ear file and war file

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

Pinaki Poddar commented on OPENJPA-1460:
----------------------------------------

This change should not expose the persistent environment setting on to OpenJPAConfiguration interface. That method does not have a clear semantics to be on the configuration interface. Please keep the method on OpenJPAConfigurationImpl and do a conditional cast to solve the problem at hand.. 

> Fix scope visibility of orm.xml when it is packaged in both ear file and war file
> ---------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1460
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1460
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.0.0-M3, 2.0.0-beta
>            Reporter: Fay Wang
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-1460-1.patch, OPENJPA-1460-2.patch, OPENJPA-1460-3.patch, OPENJPA-1460-4.patch, OPENJPA-1460.patch
>
>
> Per JPA 2.0 spec, section 8.2.2:
> An EJB-JAR, WAR, application client jar, or EAR can define a persistence unit. When referencing a persistence unit using the unitName annotation element or persistence-unit-name deployment descriptor element, the visibility scope of the persistence unit is determined by its point of definition:
> (1) A persistence unit that is defined at the level of an EJB-JAR, WAR, or application client jar is scoped to that EJB-JAR, WAR, or application jar respectively and is visible to the components defined in that jar or war.
> (2) A persistence unit that is defined at the level of the EAR is generally visible to all components in the application. However, if a persistence unit of the same name is defined by an EJB-JAR, WAR, or application jar file within the EAR, the persistence unit of that name defined at EAR level will not be visible to the components defined by that EJB-JAR, WAR, or application jar file unless the persistence unit reference uses the persistence unit name # syntax to specify a path name to disambiguate the reference. When the # syntax is used, the path name is relative to the referencing application component jar file. For example, the syntax ../lib/persistenceUnitRoot. jar#myPersistenceUnit refers to a persistence unit whose name, as specified in the name element of the persistence.xml file, is myPersistenceUnit and for which the relative path name of the root of the persistence unit is ../lib/persistenceUnitRoot. jar. The # syntax may be used with both the unitName annotation element
> or persistence-unit-name deployment descriptor element to reference a persistence unit defined at EAR level.

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


[jira] Updated: (OPENJPA-1460) Fix scope visibility of orm.xml when it is packaged in both ear file and war file

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

Fay Wang updated OPENJPA-1460:
------------------------------

    Attachment: OPENJPA-1460-2.patch

> Fix scope visibility of orm.xml when it is packaged in both ear file and war file
> ---------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1460
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1460
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Fay Wang
>            Assignee: Fay Wang
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-1460-1.patch, OPENJPA-1460-2.patch, OPENJPA-1460.patch
>
>
> Per JPA 2.0 spec, section 8.2.2:
> An EJB-JAR, WAR, application client jar, or EAR can define a persistence unit. When referencing a persistence unit using the unitName annotation element or persistence-unit-name deployment descriptor element, the visibility scope of the persistence unit is determined by its point of definition:
> (1) A persistence unit that is defined at the level of an EJB-JAR, WAR, or application client jar is scoped to that EJB-JAR, WAR, or application jar respectively and is visible to the components defined in that jar or war.
> (2) A persistence unit that is defined at the level of the EAR is generally visible to all components in the application. However, if a persistence unit of the same name is defined by an EJB-JAR, WAR, or application jar file within the EAR, the persistence unit of that name defined at EAR level will not be visible to the components defined by that EJB-JAR, WAR, or application jar file unless the persistence unit reference uses the persistence unit name # syntax to specify a path name to disambiguate the reference. When the # syntax is used, the path name is relative to the referencing application component jar file. For example, the syntax ../lib/persistenceUnitRoot. jar#myPersistenceUnit refers to a persistence unit whose name, as specified in the name element of the persistence.xml file, is myPersistenceUnit and for which the relative path name of the root of the persistence unit is ../lib/persistenceUnitRoot. jar. The # syntax may be used with both the unitName annotation element
> or persistence-unit-name deployment descriptor element to reference a persistence unit defined at EAR level.

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


[jira] Updated: (OPENJPA-1460) Fix scope visibility of orm.xml when it is packaged in both ear file and war file

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

Fay Wang updated OPENJPA-1460:
------------------------------

    Attachment: OPENJPA-1460-3.patch

This patch fixes the violation of the principle of spec-agnostic  OpenJPAConfiguration.  

> Fix scope visibility of orm.xml when it is packaged in both ear file and war file
> ---------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1460
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1460
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Fay Wang
>            Assignee: Fay Wang
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-1460-1.patch, OPENJPA-1460-2.patch, OPENJPA-1460-3.patch, OPENJPA-1460.patch
>
>
> Per JPA 2.0 spec, section 8.2.2:
> An EJB-JAR, WAR, application client jar, or EAR can define a persistence unit. When referencing a persistence unit using the unitName annotation element or persistence-unit-name deployment descriptor element, the visibility scope of the persistence unit is determined by its point of definition:
> (1) A persistence unit that is defined at the level of an EJB-JAR, WAR, or application client jar is scoped to that EJB-JAR, WAR, or application jar respectively and is visible to the components defined in that jar or war.
> (2) A persistence unit that is defined at the level of the EAR is generally visible to all components in the application. However, if a persistence unit of the same name is defined by an EJB-JAR, WAR, or application jar file within the EAR, the persistence unit of that name defined at EAR level will not be visible to the components defined by that EJB-JAR, WAR, or application jar file unless the persistence unit reference uses the persistence unit name # syntax to specify a path name to disambiguate the reference. When the # syntax is used, the path name is relative to the referencing application component jar file. For example, the syntax ../lib/persistenceUnitRoot. jar#myPersistenceUnit refers to a persistence unit whose name, as specified in the name element of the persistence.xml file, is myPersistenceUnit and for which the relative path name of the root of the persistence unit is ../lib/persistenceUnitRoot. jar. The # syntax may be used with both the unitName annotation element
> or persistence-unit-name deployment descriptor element to reference a persistence unit defined at EAR level.

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


[jira] Updated: (OPENJPA-1460) Fix scope visibility of orm.xml when it is packaged in both ear file and war file

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

Fay Wang updated OPENJPA-1460:
------------------------------

    Attachment: OPENJPA-1460-5.patch

Made changes according to Pinaki's suggestion.

> Fix scope visibility of orm.xml when it is packaged in both ear file and war file
> ---------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1460
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1460
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.0.0-M3, 2.0.0-beta
>            Reporter: Fay Wang
>            Assignee: Donald Woods
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-1460-1.patch, OPENJPA-1460-2.patch, OPENJPA-1460-3.patch, OPENJPA-1460-4.patch, OPENJPA-1460-5.patch, OPENJPA-1460.patch
>
>
> Per JPA 2.0 spec, section 8.2.2:
> An EJB-JAR, WAR, application client jar, or EAR can define a persistence unit. When referencing a persistence unit using the unitName annotation element or persistence-unit-name deployment descriptor element, the visibility scope of the persistence unit is determined by its point of definition:
> (1) A persistence unit that is defined at the level of an EJB-JAR, WAR, or application client jar is scoped to that EJB-JAR, WAR, or application jar respectively and is visible to the components defined in that jar or war.
> (2) A persistence unit that is defined at the level of the EAR is generally visible to all components in the application. However, if a persistence unit of the same name is defined by an EJB-JAR, WAR, or application jar file within the EAR, the persistence unit of that name defined at EAR level will not be visible to the components defined by that EJB-JAR, WAR, or application jar file unless the persistence unit reference uses the persistence unit name # syntax to specify a path name to disambiguate the reference. When the # syntax is used, the path name is relative to the referencing application component jar file. For example, the syntax ../lib/persistenceUnitRoot. jar#myPersistenceUnit refers to a persistence unit whose name, as specified in the name element of the persistence.xml file, is myPersistenceUnit and for which the relative path name of the root of the persistence unit is ../lib/persistenceUnitRoot. jar. The # syntax may be used with both the unitName annotation element
> or persistence-unit-name deployment descriptor element to reference a persistence unit defined at EAR level.

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