-->
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.  [ 1 post ] 
Author Message
 Post subject: Help configuring Hibernate with weblogic 8.1, Oracle 9i
PostPosted: Tue Mar 06, 2007 8:34 am 
Newbie

Joined: Tue Mar 06, 2007 6:20 am
Posts: 1
Location: India
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.