[jboss-jira] [JBoss JIRA] (WFLY-1322) CDI BeanManager (WeldBeanManagerServiceProcessor) needs to be created during Phase.FIRST_MODULE_USE for applications that have JPA classes that are rewritten/enhanced during deployment
Scott Marlow (JIRA)
jira-events at lists.jboss.org
Wed May 8 09:28:54 EDT 2013
[ https://issues.jboss.org/browse/WFLY-1322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12772970#comment-12772970 ]
Scott Marlow commented on WFLY-1322:
------------------------------------
I'm not sure that a (lazy) proxy to the bean manager will help, since the bean manager might be passed in when we create the EntityManagerFactory during the Phase.FIRST_MODULE_USE phase (for applications that need to enhance/rewrite JPA classes). The proxied bean manager would be used during the creation of the entity manager factory (deployment time) rather than runtime.
Sounds to me like we should either allow a deployment to use a CDI bean manager or bytecode enhance JPA classes.
Another question, when the CDI SPI is used to do the following, does Weld rewrite the deployment classes?
{quote}
* Create an AnnotatedType instance for the entity listener class.
* Create an InjectionTarget instance for the annotated type.
* Create a CreationalContext.
* Instantiate the listener by calling the InjectionTarget produce method.
* Inject the listener instance by calling the InjectionTarget inject method on the instance.
* Invoke the PostConstruct callback, if any, by calling the InjectionTarget postConstruct method on the instance.
{quote}
> CDI BeanManager (WeldBeanManagerServiceProcessor) needs to be created during Phase.FIRST_MODULE_USE for applications that have JPA classes that are rewritten/enhanced during deployment
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: WFLY-1322
> URL: https://issues.jboss.org/browse/WFLY-1322
> Project: WildFly
> Issue Type: Feature Request
> Components: CDI / Weld
> Affects Versions: 8.0.0.Alpha2
> Reporter: Scott Marlow
> Assignee: Stuart Douglas
>
> The JPA deployment subsystem, needs to pass a (deployment) CDI bean manager instance into the persistence provider, when creating the (container) entity manager factory.
> If JPA detects that classfile enhancing might be needed for the persistence units classes, the entity manager factory is created during the Phase.FIRST_MODULE_USE phase (so that JPA transformers can be registered before any deployer accesses the deployment classloader).
> If JPA classfile rewriting is not needed, the entity manager factory is created during the Phase.INSTALL phase.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list