-->
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: 2PC
PostPosted: Wed Nov 16, 2005 11:09 am 
Newbie

Joined: Wed Nov 16, 2005 10:53 am
Posts: 2
Hello
We are starting with Hibernate, and I would like to know if it is possible to use 2 phase commit ? I read some posts on it, but it seams that a session is connected to 1 DB and as the transaction object is derived from the session, I assume there is no way to use 2 phase commit.

Some posts use 2 transactions, but of cours, that's no 2 phase commit.

We ar working on 2 oracle DB's (10G) with OC4J container from the Oracle application server.

Using JTA, without hibernate , i can commit to 2 tables on different DB's in 1 transaction. So.... can the last version of hibernate do this to ? ( as it is build on top of JTA, i think)

grtz,

Chris.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 16, 2005 12:01 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
2 PC is handled by the jta/jdbc layer not hibernate; as hibernate uses jta/jdbc it works.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 17, 2005 4:19 am 
Newbie

Joined: Wed Nov 16, 2005 10:53 am
Posts: 2
Max,

That's what i'm saying, using JTA it works. And because Hibernate is build on top of JTA......
But I find no Hibernate API that gives me the possibility commit 2 sessions from different databases in 1 transaction. I see your are from the Hibernate Team, so i'm sure you can supply me with a link to some example where the 2PC is used through hibernate api's :-) ?

Grtz,
Chris.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 17, 2005 4:43 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Hibernate has no 2 PC API and it doe's not it it, it is "transparent". Just deploy your application to j2ee container. More "transparent" way is to use multiple databases as distributed database (You will se it as single database). 2 PC is more usefull for stuff like JMS.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 17, 2005 5:29 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Hibernate is not build on top of JTA, it is build on top of a connection which itself is registred in a JTA Tx.

_________________
Emmanuel


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.