We use WebSphere Transaction Management and would like to associate an EntityManager with every Transaction via WebSphere.
Unfortunately, WebSphere does not inject the EntityManager.
The only log it writes is:
Code:
[11.11.13 14:46:22:730 CET] 0000000f JPAPUnitInfo E CWWJP0009E:
Der Server kann keine EntityManagerFactory-Factory für die persistente Einheit AVAM_PERSISTENCE_UNIT aus dem Provider org.hibernate.ejb.HibernatePersistence
im Modul file:/C:/projects/clearcase/X60005065_view_cr_1134_Hibernate/AVAM-NEU-sources-VOB/AVAM-RSA/AVAM_Common/compiledClasses/ erstellen.
In the Code an EntityManger can be instantiated and used without further problems with
entityManagerFactory = javax.persistence.Persistence.createEntityManagerFactory("AVAM_PERSISTENCE_UNIT");
I wonder if anybody else uses WebShere 7 and Hibernate 4 and knows what the problem might be.
Code to inject:
Code:
@PersistenceContext(unitName="AVAM_PERSISTENCE_UNIT", type=PersistenceContextType.TRANSACTION)
EntityManager entityManager;
persistence.xml
Code:
<persistence-unit name="AVAM_PERSISTENCE_UNIT" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/dsAVAM</jta-data-source>
<class>ch.admin.bit.avam.administration.model.Code</class>
<properties>
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.WebSphereExtendedJtaPlatform" />
<property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory" />
<property name="hibernate.session_factory_name" value="java:hibernate/SessionFactory" />
<property name="jta.UserTransaction" value="java:comp/UserTransaction"/>
<property name="current_session_context_class" value="jta" /> <!-- jta, thread, managed, or custom.Class -->
...