tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <david.blev...@gmail.com>
Subject Re: HowTo Configure hibernate.jndi.url for Tests
Date Wed, 20 Apr 2011 15:12:49 GMT

On Apr 20, 2011, at 8:15 AM, Andrew Hughes wrote:

> Hi All,
> 
> The hibernate layer I am trying to test requires a url for the JNDI
> provider, defined by 'hibernate.jndi.url'.
> 
> See
> http://docs.jboss.org/hibernate/core/3.3/reference/en/html/session-configuration.html#configuration-hibernatejdbc
> (Table
> 3.2. Hibernate Datasource Properties).
> 
> Can I get a jndi provider url from OpenEJB?

Hi Andrew!

When Hibernate is used as the JPA provider we automatically set this property:

  hibernate.transaction.manager_lookup_class=org.apache.openejb.hibernate.TransactionManagerLookup

To use Hibernate as plain Hibernate the same property should work.  I seem to recall that
the JNDI approach is ultimately just for getting the transaction manager via the built-in
JndiManagerLookup (or whatever it is called). The OpenEJB lookup impl uses a static and will
definitely be faster.

-David


Mime
View raw message