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>