-->
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.  [ 6 posts ] 
Author Message
 Post subject: Transaction handling in Hibernate 2.1 and CMT
PostPosted: Tue Nov 15, 2005 9:02 am 
Newbie

Joined: Thu Sep 08, 2005 2:43 am
Posts: 6
I have found lots of documentation about transaction handling in Hibernate 3 in combination with CMT.

The problem is that I'm running Hibernate 2.1 and the transaction handling doesn't work as intended.

Does anyone have a link to some useful documentation or can anyone explain how it's supposed to work?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 15, 2005 10:43 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
If you correctly set Hibernate's TransactionManager and UserTransaction lookup classes there should be no problem using Hibernate with CMT.

http://www.hibernate.org/hib_docs/v3/re ... onstrategy

Then use something like HibernateUtil class introduced in 'Hibernare in action'.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 15, 2005 10:47 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
It's the same in H2:
http://www.hibernate.org/hib_docs/refer ... onstrategy


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 15, 2005 11:01 am 
Newbie

Joined: Thu Sep 08, 2005 2:43 am
Posts: 6
Thank you for your reply.

The thing with the TransactionManagerLookup is that I'm running Sybase EAServer and I can't find an appropritate class to use so I have not been able to test this.
But I guess this is the catch...?

What does this mean (quoted from your link):

"net.sf.hibernate.transaction.JDBCTransactionFactory
delegates to database (JDBC) transactions (default)
"

?

Can I use net.sf.hibernate.transaction.JTATransactionFactory without specifying a TransactionManagareLookup class?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 15, 2005 11:07 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
Quote:
What does this mean (quoted from your link):
"net.sf.hibernate.transaction.JDBCTransactionFactory
delegates to database (JDBC) transactions (default)"


This is useful when you have single datasource - and the underlaying connection is used as a 'transaction'

Quote:
Can I use net.sf.hibernate.transaction.JTATransactionFactory without specifying a TransactionManagareLookup class?

Probably not. Look at the already implemented TransactionManagareLookup classes. It's really simple to write one for your EAServer.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 15, 2005 11:13 am 
Newbie

Joined: Thu Sep 08, 2005 2:43 am
Posts: 6
Thank you, you are a good man Alesj :) I'll credit you.

I'll look up the existing TransactionManagerLookup classes and see if I could create one myself.

And then I'll take cover - we have a snow storm coming tonight (Sweden)...


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