You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by "John D. Ament (JIRA)" <ji...@apache.org> on 2017/08/12 21:54:00 UTC
[jira] [Resolved] (DELTASPIKE-1281) Deltaspike does not pass
BeanManager to persistenf factory config using
"javax.persistence.bean.manager"
[ https://issues.apache.org/jira/browse/DELTASPIKE-1281?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
John D. Ament resolved DELTASPIKE-1281.
---------------------------------------
Resolution: Fixed
Done.
> 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
> Assignee: John D. Ament
> Fix For: 1.8.1
>
>
> 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)