-->
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: Use JTA transactions in WAS 5.1
PostPosted: Fri Nov 26, 2004 2:59 am 
Newbie

Joined: Fri Nov 26, 2004 2:45 am
Posts: 1
Hibernate version:
2.1.3

Hi guys,
I am concerning how to convert the hibernate-based applicaction between JDBC transaction and JTA transaction transparently. And I have explored the hibernate source code and found out that, if we use a JTA transaction, hibernate will lookup a UserTransaction first and check if there is already another JTATransaction existing. If so, hibernate will not create a JTA transaction and join the existing one. So in this way, hibernate propose to make the application which uses hibernate transaction API can switch between JDBC and JTA transaction even CMT transparently without any code changing.

But in my application, I invode hibernate code in a Container Management Transaction Stateless Session Bean which is configured with Required transaction attribute in WAS 5.1. And in WAS 5.1, if a SLSB is CMT, the container will not provide a user transaction. That means we can't lookup a UserTransaction by "java:comp/UserTransaction". There will be an exception said that there is no comp/UserTransaction in java context. But hibernate does use this way to get JTA transaction. And I know I can configure the JTA transaction lookup name in cfg file, but the "jta/usertransaction" doesn't work with SLSB in WAS either.


So any knows how to make these kind of switching without changing code?

Thanks


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.