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 Thu, 21 Apr 2011 08:16:27 GMT
On Thu, Apr 21, 2011 at 3:08 AM, Andrew Hughes <ahhughes@gmail.com> wrote:
> 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

Hi Andrew,

My usefulness may have run out then, I'm not sure what that property
does.  JNDI of the non "java:comp/env" variety is all non-portable in
Java EE 5 and before, so likely its more a question of what exactly
does hibernate need from JNDI.

Don't have time to research that property, but if you let me know what
that property needs to do specifically I might be able to help better.


-David

>
>
>
> 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
View raw message