Thanks, Paolo, for taking a shot at helping out Thomas. You set a good example and it's very appreciated!

Thomas, we don't have any code that changes the provider on persistence-units. Can you post your log output? There should be some lines that look like:

Configuring PersistenceUnit(name={0}, provider={1})
PersistenceUnit(name={0}, provider={1})


-David


On Feb 6, 2009, at 7:00 AM, Paolo Spadafora wrote:

I understand, probably david or some other openejb developer can help you out.

Paolo


-----Messaggio originale-----
Da: hamtho [mailto:thamac...@project-team.de]
Inviato: venerdì 6 febbraio 2009 14.16
A: users@openejb.apache.org
Oggetto: Re: R: How to enable/disable Hibernate EntityManager


Paolo,

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
<provider>-tag.

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?

Thanks
Thomas





p.spadafora wrote:

Hi,
I am not sure of your problem.
But I think
<property name="hibernate.hbm2ddl.auto" 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 [mailto:thamac...@project-team.de]
Inviato: venerdì 6 febbraio 2009 11.14
A: users@openejb.apache.org
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="http://java.sun.com/xml/ns/persistence"; 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="hibernate.hbm2ddl.auto" value="update" 
/>
                        <property name="openjpa.jdbc.SynchronizeMappings"
value="buildSchema(ForeignKeys=true)" />
                 <property name="hibernate.transaction.manager_lookup_class"
value="ch.bmw.service.DynamicTransactionManagerLookup"/>
                
                </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:
http://www.nabble.com/How-to-enable-disable-Hibernate-EntityManager-tp21869752p21869752.html
Sent from the OpenEJB User mailing list archive at Nabble.com.





--
View this message in context: 
http://www.nabble.com/How-to-enable-disable-Hibernate-EntityManager-tp21869752p21872186.html
Sent from the OpenEJB User mailing list archive at Nabble.com.




Reply via email to