-
1. Re: Hibernate sessionfactory jndi bindingc
smarlow Apr 19, 2012 3:02 PM (in response to tomsmith)Are you setting the "hibernate.session_factory_name" property? Above you said "session_factory_name".
-
2. Re: Hibernate sessionfactory jndi bindingc
smarlow Apr 19, 2012 3:10 PM (in response to smarlow)1 of 1 people found this helpfulYou shouldn't have to set it but there is also a new property "hibernate.session_factory_name_is_jndi" that you could set to true if you like.
Also might not hurt to enable TRACE logging for org.hibernate and org.jboss.as.jpa (see link here for instructions.)
-
3. Re: Hibernate sessionfactory jndi bindingc
tomsmith Apr 19, 2012 4:39 PM (in response to smarlow)Scott, thank you! This bugged me a whole day. The property worked like a charme on Jboss6... "hibernate.session_factory_name" is the right name!
-
4. Re: Hibernate sessionfactory jndi bindingc
tomsmith Apr 19, 2012 5:38 PM (in response to smarlow)Okay, there is another minor problem raised. I found some entries in google but none of them were actually in the situation of jboss7/hibernate4. Mentioned solutions do not work.
org.hibernate.service.jndi.JndiException: Unable to lookup JNDI name [java:comp/UserTransaction]
I know that java:comp/UserTransaction is only visible for container created threads of jee, so not for my quartz threads.
The right thing for me seems to be java:jboss/UserTransaction
none of the mentioned config options worked for me. There is always java:comp/UserTransaction looked up from hibernate which fails in quartz threads.
I tried:
<property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
<property name="jta.UserTransaction" value="java:jboss/UserTransaction"/>
jta.UserTransaction property is listed in hibernate docs.
I replaced the last one already with following possiblities, of which none had an effect:
<property name="hibernate.jta.UserTransaction" value="java:jboss/UserTransaction"/>
<property name="jta.UserTransaction" value="java:jboss/UserTransaction"/>
<property name="jta.UserTransactionName" value="java:jboss/UserTransaction"/>
<property name="hibernate.jta.UserTransactionName" value="java:jboss/UserTransaction"/>
jboss says at startup:
23:31:19,113 INFO [org.hibernate.engine.transaction.internal.TransactionFactoryInitiator] (MSC service thread 1-3) HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jta.JtaTransactionFactory
transactions work in the normal application!
Thanks again!