-->
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.  [ 2 posts ] 
Author Message
 Post subject: OC4J Unable to locate current JTA transaction Exception
PostPosted: Wed Oct 04, 2006 4:14 pm 
Newbie

Joined: Wed Oct 04, 2006 2:48 pm
Posts: 1
I am trying to deploy hibernate (3.1.3) in OC4J 10.1.2. When I attempt to run my application I get the following exception:

org.hibernate.HibernateException: Unable to locate current JTA transaction
at org.hibernate.context.JTASessionContext.currentSession(JTASessionContext.java:61)
at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:508) at com.tomax.persist.hibernate.HibernatePersistenceBase.retrieve(HibernatePersistenceBase.java:221) at com.tomax.domain.employee.EmployeeDomain.retrieve(EmployeeDomain.java:70)
at com.tomax.domain.employee.ejb.EmployeeEJB.retrieve(EmployeeEJB.java:65)
at EmployeeRemote_StatelessSessionBeanWrapper42.retrieve(EmployeeRemote_StatelessSessionBeanWrapper42.java:2721) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:124)
at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)

This happens after I make a call to SessionFactory.getCurrentSession(); I am not sure if this is a configuration issue of if there is an incompatability between hibernate and OC4J 10.1.2. I have tried reading up on the configuration of both the app server and hibernate and have tried different configurations. They all seem to lead to the same excpetion. Has anyone seen this issue? Also if you have gotten hibernate to work in OC4J it would be good to know that it is not an compatability issue. Thanks.


Here is the hibernate config:

<hibernate-configuration>
<session-factory>
<property name="hibernate.cglib.use_reflection_optimizer">true</property>
<property name="hibernate.connection.datasource">jdbc/DevDS</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.OC4JTransactionManagerLookup</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
<property name="hibernate.cache.use_minimal_puts">true</property>
<property name="hibernate.cache.use_query_cache">true</property>
<property name="hibernate.transaction.auto_close_session">true</property>
<property name="hibernate.transaction.flush_before_completion">true</property>
<property name="hibernate.current_session_context_class">jta</property>
<property name="show_sql">false</property>
</session-factory>
</hibernate-configuration>


Top
 Profile  
 
 Post subject: Same thing here (OC4J 10.1.3)
PostPosted: Mon Nov 06, 2006 2:55 pm 
Newbie

Joined: Mon Nov 06, 2006 2:41 pm
Posts: 1
Location: Edmonton
Doesn't seem like a problem with Hibernate though. The transaction manager is there, it just returns null for transaction. According to the code in org.hibernate.context.JTASessionContext class if transaction manager returns null, the context is not trying to begin a new transaction but throws HibernateException. Here's the exact place (lines 59-62):

Code:
txn = transactionManager.getTransaction();
if ( txn == null ) {
   throw new HibernateException( "Unable to locate current JTA transaction" );
}


I don't know if the context should try to start a new transaction when this happens. Probably not. It's the application server's job to do JTA.

Any help is appreciated.

Thanks.


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