[hibernate-dev] Is this a bug or am I just handling it the wrong way ?
joël Winteregg
joel.winteregg at gmail.com
Wed Mar 12 09:43:21 EDT 2008
Hello Chris,
Thanks for your email. As you will notice I posted a related question on
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3110 this
morning.
>
> I haven't looked closely enough to comment on the query problem but I
> can confirm that your assessment above is correct. JTATransaction has
> and always has had a dependency on JNDI. It's only been recently
> uncovered because a) we changed how/when the transaction was
> instantiated and b) it turns out some folks are using JTA services
> outside the container that don't bind to JNDI. If you want to use such
> a service, you're exactly right - also use a JNDI service or create a
> TransactionFactory/Transaction combo that doesn't need JNDI.
The strange thing is that I'm also using JNDI with my Transaction
Manager - System.setProperty("java.naming.factory.initial",
"org.apache.naming.java.javaURLContextFactory");.
And Hibernate is fetching the JTA service using the following lookup
class:
http://docs.codehaus.org/display/BTM/Hibernate#Hibernate-Transactionmanagerlookupclass
Using the following Hibernate config:
<property name="transaction.manager_lookup_class">
db.BitronixTransactionManagerLookup
</property>
<property name="transaction.factory_class">
org.hibernate.transaction.JTATransactionFactory
</property>
As I understood from your post on issue HHH-3110, Hibernate should not
use a lookup class anymore but create (instance) the Transaction
Manager. Am I right ? If so, to do this, I should implement a
org.hibernate.transaction.TransactionFactory for my transaction
manager ?
> This is
> trivial IMHO (though I haven't done it). And of course if you do this,
> please share :)
Of course, if some of my code could help, I will provide it :-)
Thanks for your help and best regards,
Joël
More information about the hibernate-dev
mailing list