[jboss-jira] [JBoss JIRA] (AS7-4996) PersistenceUnitInfo.addTransformer(ClassTransformer transformer) needs to occur before class definition

Scott Marlow (JIRA) jira-events at lists.jboss.org
Mon Jul 2 14:26:12 EDT 2012


    [ https://issues.jboss.org/browse/AS7-4996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12704204#comment-12704204 ] 

Scott Marlow commented on AS7-4996:
-----------------------------------

Started hacking changes for this here https://github.com/scottmarlow/jboss-as/tree/AS7-4996_class_transformer_part2 and some discussion here http://lists.jboss.org/pipermail/jboss-as7-dev/2012-July/006258.html
                
> PersistenceUnitInfo.addTransformer(ClassTransformer transformer) needs to occur before class definition
> -------------------------------------------------------------------------------------------------------
>
>                 Key: AS7-4996
>                 URL: https://issues.jboss.org/browse/AS7-4996
>             Project: Application Server 7
>          Issue Type: Bug
>          Components: JPA / Hibernate
>    Affects Versions: 7.1.2.Final (EAP)
>            Reporter: Scott Marlow
>            Assignee: Scott Marlow
>             Fix For: 7.2.0.Alpha1
>
>         Attachments: jpa_classtransformer_irc.txt
>
>
> Using the Hibernate property in a persistence.xml should result in the hibernate.ejb.use_class_enhancer application entity classes being enhanced by Hibernate.  But this only works before the classes are loaded.
> The same problem also has been reported by community users trying to use similar features with Versant/OpenJPA (EclipseLink will probably have the same issue). 
> Question: What happened to the AS7-2233 changes?  Answer, AS7-2233 only fixed enough so to avoid some errors that were occurring but not enough for complete class_enhancer support.
> Note that there was IRC discussion about the other ways to address this on #jboss-as7 (I'll attach a transcript later).
> One possible solution:
> - Only if classes are being enhanced or could be enhanced, would the other below steps be taken.
> - When deploying the deployment persistence unit definitions, create a new application level classloader (similar to [temp classloader|https://github.com/jbossas/jboss-as/blob/master/jpa/core/src/main/java/org/jboss/as/jpa/classloader/TempClassLoader.java]).
> - PersistenceUnitInfo.getClassLoader() will return the new classloader. 
> - Each entity manager invocation will set the TCCL to the PersistenceUnitInfo.getClassLoader().

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

        


More information about the jboss-jira mailing list