tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Hughes <ahhug...@gmail.com>
Subject Re: HowTo Configure hibernate.jndi.url for Tests
Date Thu, 21 Apr 2011 01:08:08 GMT
Hi David,

Thanks for your reply, but I really need a 'hibernate.jndi.url' - our
(inherited) codebase depends on it. I would like to know this at compile
time (because the code reads in a property file), but if I really have to
(if its even possible) I could programatically look it up from OpenEJB with
a TestNG @BeforeSuite{} and create the properties file before it gets read
in (sounds aweful I know).

Thanks again, hopefully there is something I can work with here :)
--AH



On Thu, Apr 21, 2011 at 12:42 AM, David Blevins <david.blevins@gmail.com>wrote:

>
> 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message