-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate4 <-> Jboss7 Problem (java:jboss/UserTransaction)
PostPosted: Fri Apr 20, 2012 3:47 am 
Newbie

Joined: Sat Sep 12, 2009 12:50 pm
Posts: 6
While porting my application from Jboss6 to Jboss7 there is another problem raised 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!


Code that raises the exception is (the last line actually leads to exception):

sqlSession = HibernateUtil.getSessionFactory().openSession();
tx = sqlSession.beginTransaction();




Thanks again!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.