Hi All,
I am very new to Hibernate. I am trying to configure weblogic 8.1, Oacle 9i, and Hibernate 3.2.0
My cfg file is
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.username">weblogic</property>
<property name="connection.password">weblogic</property>
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="connection.datasource">PBDS</property>
<property name="transaction.manager_lookup_class">org.hibernate.transaction.WeblogicTransactionManagerLookup</property>
<property name="transaction.factory.class">org.hibernate.transaction.JTATransactionFactory</property >
<property name ="jndi.class">weblogic.jndi.WLInitialContextFactory</property>
<!--property name="jndi.url">t3://127.0.0.1:7050</property -->
<property name="jndi.url">t3://localhost:7001</property>
<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">jta</property>
<mapping resource="Emp.hbm.xml"/>
</session-factory>
</hibernate-configuration >
File file = new File("C:\\bea\\user_projects\\domains\\mydomain\\hibernate.cfg.xml");
SessionFactory sessionFactory = new Configuration().configure(file).buildSessionFactory();
Session session = sessionFactory.getCurrentSession();
I get exception saying
org.hibernate.HibernateException: Unable to locate current JTA transaction while I try to get session using Session session=sessionFactory.getCurrentSession();
Please help me
_________________ Regards
Rajesh Thakare
|