-->
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.  [ 5 posts ] 
Author Message
 Post subject: Hibernate not working in a bean managed transaction env.
PostPosted: Mon Nov 21, 2005 12:55 pm 
Newbie

Joined: Mon Nov 21, 2005 12:47 pm
Posts: 1
Hi, I'm having trouble using Hibernate 3 with bean managed transactions (BMT). I have currently adopted a thread local approach to transaction management, but I would prefer to use the global transaction provided by my J2EE container (Websphere version 5.1). Also, as an FYI, my database is DB2, version 8.1

In my hibernate config file, I have the following items:
<property name="hibernate.transaction.factory_class">
org.hibernate.transaction.JTATransactionFactory</property>
<property name="jta.UserTransaction">
java:comp/UserTransaction</property>
<property name="hibernate.transaction.manager_lookup_class">
org.hibernate.transaction.WebSphereTransactionManagerLookup</property>

Furthermore, my EJB's are configured for BMT. When I invoke the code:
sessionFactory.getCurrentSession(), hibernate throws a HibernateException...the excepiton is "Could not located global transaction"

I'm not sure why this error arrises. I have written a test case that does a JNDI lookup of "java:comp/UserTransaction" and I am able to find the UserTransaction object without problem.

Anyone have any ideas?

Thanks...
Mike


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 05, 2006 1:21 am 
Newbie

Joined: Wed Jan 04, 2006 10:01 pm
Posts: 17
did you solve your problem?
I have a similar one, if I do tx.begin() before sessionFactory.getCurrentSession() it works and I can read from the database, but later on it does not write to the database when I commit()...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 12:44 pm 
Beginner
Beginner

Joined: Fri Jan 13, 2006 8:07 am
Posts: 29
Have you solved the problem ?

I have got the same problem. If you solved , how did you solve it ?

Thanks,

JSV.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 1:27 pm 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
PMO wrote:
did you solve your problem?
I have a similar one, if I do tx.begin() before sessionFactory.getCurrentSession() it works and I can read from the database, but later on it does not write to the database when I commit()...

You must start transaction if you are using BMT, "currentSession" is mapped to transaction.


Top
 Profile  
 
 Post subject: BMT?
PostPosted: Mon Jan 16, 2006 4:23 pm 
Beginner
Beginner

Joined: Fri Jan 13, 2006 8:07 am
Posts: 29
can you say what is the BMT means please ?


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