-->
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: JTATransaction issue
PostPosted: Tue Jul 15, 2008 5:04 pm 
Newbie

Joined: Fri Mar 28, 2008 12:18 pm
Posts: 3
Location: Tamp
Hi
I am getting the following exception in my application. This issue is appering randomly i.e most of the time it will work with out any excpetion but some time am getting this exception . The code & the hibernate config which am using is mentioned below. Please help me in finding the solution for this.

Thanks in advance.


2008-07-14 13:32:25,896 [pool-4-thread-18] ERROR org.hibernate.transaction.JTATransaction -Could not find UserTransaction in JNDI
javax.naming.NameNotFoundException: While trying to look up comp/UserTransaction in /app/webapp/ness/25701656.; remaining name 'comp/UserTransaction'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.ApplicationNamingNode.lookup(ApplicationNamingNode.java:142)
at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:269)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:362)
at weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(ReadOnlyContextWrapper.java:45)
at weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.java:130)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at org.hibernate.transaction.JTATransaction.begin(JTATransaction.java:58)
at org.hibernate.transaction.JTATransactionFactory.beginTransaction(JTATransactionFactory.java:53)
at org.hibernate.jdbc.JDBCContext.beginTransaction(JDBCContext.java:271)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1079)
at com.citi.ness.dao.LargeBatchDetailDAO.updateFileStatus(LargeBatchDetailDAO.java:419)
at com.citi.ness.lbfilemanager.NESSOutputTransformerThread.splitNessOutput(NESSOutputTransformerThread.java:150)
at com.citi.ness.lbfilemanager.NESSOutputTransformerThread.run(NESSOutputTransformerThread.java:45)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)



Code:
Session session sessionFactory.openSession();
Transaction tran = null;
      try {
         tran = session.beginTransaction();
         session.update(aLargeBatchFilePropertiesVO);
         tran.commit();
         session.flush();
         session.close();
      }catch (GenericJDBCException he) {
         if(tran !=null){ tran.rollback(); }
         he.getSQLException().printStackTrace();
         Log.logError(LOGGER_NAME, he,"Exception while updating the File Status for File Name>> "+aLargeBatchFilePropertiesVO.getInFileName());
      }
      finally {
         session .close();
      }


Code:
<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
      <property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
      <property name="hibernate.connection.datasource">MYDataSource</property>
      <property name="hibernatecglib.use_reflection_optimizer">false</property>
      <property name="hibernate.connection.pool_size">10</property>
        <property name="hibernate.show_sql">false</property>
        <property name="dialect">org.hibernate.dialect.OracleDialect</property>
      <property name="hibernate.jdbc.batch_size">20</property>
      <property name="hibernate.cache.use_second_level_cache">false</property>


Top
 Profile  
 
 Post subject: Re: JTATransaction issue
PostPosted: Wed Jul 16, 2008 11:38 am 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
In hibernate properties, set TransactionManagerLookupStrategy to org.hibernate.transaction.WeblogicTransactionManagerLookup and see if it helps.

Farzad-


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.