[
https://issues.jboss.org/browse/AS7-4996?page=com.atlassian.jira.plugin.s...
]
Scott Marlow commented on AS7-4996:
-----------------------------------
change is merged! Just need to add documentation for the new
jboss.as.jpa.classtransformer PU property (defaults to true but if set to false, class
transformers are not configured for the persistence unit)
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/...]).
- 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