[ 
https://issues.apache.org/jira/browse/OPENJPA-2226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13409298#comment-13409298
 ] 

Manuel Meyer edited comment on OPENJPA-2226 at 7/9/12 10:20 AM:
----------------------------------------------------------------

Sorry for opening this bug again, but it seems that the problem is still there. 
Like the description says, we have a similar constellation. If PU1 ist used 
first, the specified classes will be enhanced. If then using PU2, the specified 
classes won't be enhanced and will be unknown entities. In our example, we use 
the runtime enhancement via the javaagent.
                
      was (Author: mmeyer):
    Sorry for opening this bug again, but it seems that the problem is still 
there. Like the description says, we have similar constellation. If PU1 ist 
used first, the specified classes will be enhanced. If then using PU2, the 
specified classes won't be enhanced and will be unknown entities. In our 
example, we use the runtime enhancement via the javaagent.
                  
> CLONE - PCEnhancer not processing multiple PU's defined within a single 
> persistence.xml file
> --------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-2226
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2226
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.0.1, 2.2.0
>            Reporter: Manuel Meyer
>
> When multiple persistence-units are defined in the persistence.xml, only the 
> first one is examined when looking for classes to enhance when using the 
> automatic runtime enhancement (e.g., using the "-javaagent:openjpa.jar" 
> argument). So if the project uses the following persistence.xml: 
> <persistence xmlns="http://java.sun.com/xml/ns/persistence"; version="1.0"> 
>     <persistence-unit name="unit1" transaction-type="RESOURCE_LOCAL"> 
>         <class>unit1.SomeClass</class> 
>     </persistence-unit> 
>     <persistence-unit name="unit2" transaction-type="RESOURCE_LOCAL"> 
>         <class>unit2.SomeClass</class> 
>     </persistence-unit> 
> </persistence> 
> In this example, when unit1.SomeClass is loaded, it will be enhanced, but 
> unit2.SomeClass won't ever be enhanced. 
> The only workaround is to list all of your persistent classes in an initial 
> entry in the persistence-unit. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to