You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by "Alex Roytman (JIRA)" <ji...@apache.org> on 2017/07/14 22:01:00 UTC

[jira] [Created] (DELTASPIKE-1281) Deltaspike does not pass BeanManager to persistenf factory config using "javax.persistence.bean.manager"

Alex Roytman created DELTASPIKE-1281:
----------------------------------------

             Summary: Deltaspike does not pass BeanManager to persistenf factory config using "javax.persistence.bean.manager"
                 Key: DELTASPIKE-1281
                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-1281
             Project: DeltaSpike
          Issue Type: Bug
          Components: JPA-Module
    Affects Versions: 1.8.0
         Environment: Deltaspike 1.8, Weld 3.0, Java 8 (JSE) JPA with HIbernate 5.2.10
            Reporter: Alex Roytman


As the result no injections were working in JPA listeners.
Per specs Persistence UnitFactory expects BeanManager in javax.persistence.bean.manager property passed when instantiate it but org.apache.deltaspike.jpa.impl.entitymanager.PersistenceConfigurationProviderImpl does not pass it

this simple override took care of it but I should not need to do it:


{code:java}
@ApplicationScoped
@Alternative
@Priority(Interceptor.Priority.APPLICATION + 10)
public class CdiAwarePersistenceConfigurationProviderImpl extends PersistenceConfigurationProviderImpl implements PersistenceConfigurationProvider {
  @Inject BeanManager beanManager;
  @Override public Properties getEntityManagerFactoryConfiguration(String persistenceUnitName) {
    final Properties conf = super.getEntityManagerFactoryConfiguration(persistenceUnitName);
    conf.put("javax.persistence.bean.manager", beanManager);
    return conf;
  }
}
{code}




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)