-->
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.  [ 3 posts ] 
Author Message
 Post subject: Jonas, Transactions & JTA
PostPosted: Tue Aug 30, 2005 12:56 pm 
Newbie

Joined: Tue Aug 30, 2005 12:38 pm
Posts: 3
Hi,

I would like to use JTA with Jonas Application Server user so I try to configure hibernate with the right lookup class but the JTA transaction is not found.

When I try with : JOnASTransactionManagerLookup, the exception is the following one :
Code:
2005-08-30 18:47:21,856 : JFactory.postInvoke : system exception in business method:
org.hibernate.HibernateException: Could not obtain JOnAS transaction manager instance  at org.hibernate.transaction.JOnASTransactionManagerLookup.getTransactio
nManager(JOnASTransactionManagerLookup.java:24)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:
270)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.jav
a:1005)



When I try with : JOTMTransactionManagerLookup, the exception is the following one :
Code:
2005-08-30 18:18:05,448 : SessionFactoryImpl.checkNamedQueries : Checking 0 named queries
org.hibernate.HibernateException: Unable to locate current JTA transaction
        at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactor
yImpl.java:510)


I think Jonas uses JOTM to manage transaction...
Somebody knows what is wrong in my configuration ?

Code:
<hibernate-configuration>
  <session-factory>
   <property name="connection.datasource">jdbc_1</property>

    <property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
    <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JOnASTransactionManagerLookup</property>
   <property name="hibernate.session_factory_name">foo:/hibernate/SessionFactory</property>
    <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
    <property name="show_sql">true</property>
    <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
    <property name="hibernate.hbm2ddl.auto">create</property>

    <mapping resource="Client.hbm.xml"/>
    <mapping resource="Cpt.hbm.xml"/>
    <mapping resource="Adr.hbm.xml"/>
  </session-factory>
</hibernate-configuration>

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 31, 2005 3:32 am 
Newbie

Joined: Tue Aug 30, 2005 12:38 pm
Posts: 3
I check the hibernate TransactionManagerLookup sources, so JOnASTransactionManagerLookup search org.objectweb.jonas_tm.Current class. This class seems to be unavailable in my Jonas version (4.1.4).
In JOTMTransactionManagerLookup, the org.objectweb.jotm.Current class is used. It seems that this class is found. The getTransactionManager method is called, but this method return null. When I look at the Jonas code, it seems that the attribute that contains the jta connector is not yet initialized.

Somebody have got an idea about what's going wrong in my configuration ?

Thanks !


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 01, 2005 5:33 am 
Newbie

Joined: Tue Aug 30, 2005 12:38 pm
Posts: 3
It's working now for me.
The right class to use is JOTMTransactionManagerLookup (now Jonas use JOTM)
I missed a transaction attribute on my EJB method, that's why there was no transaction context. With a transaction attribute, it's OK !


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

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.