tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paolo Spadafora" <>
Subject R: R: How to enable/disable Hibernate EntityManager
Date Fri, 06 Feb 2009 15:00:04 GMT
I understand, probably david or some other openejb developer can help you out.


-----Messaggio originale-----
Da: hamtho [] 
Inviato: venerdì 6 febbraio 2009 14.16
Oggetto: Re: R: How to enable/disable Hibernate EntityManager


thanks for you reply.
There is nothing really wrong with the JBossTransactionManagerLookup. It´s
just a kind of dynamic factory which chooses, which implementation to use.
But for this test-case I could also use the JBoss one.

But my problem is not, that hibernate does not work correctly, but I wonder
why openEJB uses the plain org.hibernate.Hibernate implementation in one
case and in the other case it uses the Hibernate EntityManager
(org.hibernate.ejb.HibernatePersistence), although in both cases I defined
to use the Hibernate EntityManager in the persistence.xml through the

So there has to be a strategy how openEJB handles, which implementation to
use. I don´t know, if this comes through classpath-resolution or anything
else. But it behaves differently and I am trying to understand how it works,
to enable the Hibernate EntityManager specifically.
I do not want the plain org.hibernate.Hibernate-session to be used.

Do you understand what I mean?


p.spadafora wrote:
> Hi,
> I am not sure of your problem.
> But I think 
> <property name="" value="update" />
> Has the same meaning of
> <property name="openjpa.jdbc.SynchronizeMappings"
> value="buildSchema(ForeignKeys=true)" />
> Although, the second one is an openjpa property and should be ignored by
> hibernate provider.
> Any particular reason not to use the
> org.hibernate.transaction.JBossTransactionManagerLookup class? 
> Bye,
> Paolo
> -----Messaggio originale-----
> Da: hamtho [] 
> Inviato: venerdì 6 febbraio 2009 11.14
> A:
> Oggetto: How to enable/disable Hibernate EntityManager
> Hi,
> I´m still struggling with the EXTENDED Persistence context and
> EntityManager.
> Maybe it has anything to do, because i use the Hibernate EntityManager.
> But I´ve got the strange behaviour, that in one test case - which works
> (!!!) - only the Hibernate-Session is loaded while openEJB starts up and
> in
> the other test case - which does not work - the HibernateEntityManager is
> used.
> The persistence.xml is identical in both cases.
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence xmlns="" version="1.0">
> 	<persistence-unit name="IisPU">
> 		<jta-data-source>gerdaDatabase</jta-data-source>
> 		 <non-jta-data-source>gerdaDatabaseUnmanaged</non-jta-data-source> 
> 		 <provider>org.hibernate.ejb.HibernatePersistence</provider>
> 		<properties>
> 			<property name="" value="update" />
> 			<property name="openjpa.jdbc.SynchronizeMappings"
> value="buildSchema(ForeignKeys=true)" />
> 		 <property name="hibernate.transaction.manager_lookup_class"
> value=""/>
> 		</properties>
> 	</persistence-unit>
> </persistence>
> Is there any chance to control wheater openEJB should use Hibernate or
> HibernateEntityManager or what is the strategy of openEJB to decide which
> implementation to load?
> Maybe someone can help
> Thomas
> -- 
> View this message in context:
> Sent from the OpenEJB User mailing list archive at

View this message in context:
Sent from the OpenEJB User mailing list archive at

View raw message