-->
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.  [ 4 posts ] 
Author Message
 Post subject: Unable to locate current JTA transaction
PostPosted: Mon Mar 27, 2006 6:08 pm 
Newbie

Joined: Mon Oct 03, 2005 12:00 am
Posts: 9
Can someone please help me configure JTA. I keep getting "Unable to locate current JTA transaction". I can successfully lookup java:comp/UserTransaction in my application but Hibernate fails to find it.

Code:

<hibernate-configuration>
   <session-factory name="hibernate_SessionFactory">
      <property name="connection.datasource">jdbc/MyDS</property>
     <property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
    <property name="transaction.manager_lookup_class">com.util.MyTransactionManagerLookup</property>
      <property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
      <property name="show_sql">true</property>

     <!-- Mapping files -->
   </session-factory>
</hibernate-configuration>


Error:

The error is: javax.servlet.ServletException: Unable to locate current JTA transaction



Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 27, 2006 6:09 pm 
Newbie

Joined: Mon Oct 03, 2005 12:00 am
Posts: 9
My lookup class:

public class MyTransactionManagerLookup
extends JNDITransactionManagerLookup
{

protected String getName()
{
return "TransactionManager";
}

public String getUserTransactionName()
{
return "java:comp/UserTransaction";
}
}


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 27, 2006 10:33 pm 
Newbie

Joined: Mon Oct 03, 2005 12:00 am
Posts: 9
do I have to check for currentsession in my servlet filter and return opensession() if no active transaction is found?

Please share your experience!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 28, 2006 2:09 pm 
Newbie

Joined: Mon Oct 03, 2005 12:00 am
Posts: 9
Can someone please comment on how to get getCurrentSession to work in a non-managed environment?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.