This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Hibernate and XA datasource Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate and XA datasource" Watch "Hibernate and XA datasource" New topic
Author

Hibernate and XA datasource

manish ahuja
Ranch Hand

Joined: Oct 23, 2003
Posts: 312
Hi All,

Currently in my project we are using Hibernate with plain Oracle Driver Manager as the database connection mechanism (<property name="hibernate.connection.driver_class">oracle.jdbc.OracleDriver</property> .

Now we have been asked to use XA datasource which has to be configured in the app server. Though we have two database interaction in our application we don't have a cross transaction scenario.

I believe using XA implies 2PC which will try to synchronize transaction across the database. How can I overcome this overhead while still using XA.

Also another question is regarding Transaction Manager. Is it imperative to use the transaction manager if we want to implement XA datasource. Can I do w/out transaction manager and still have XA for database communication.

Most of the XA Hibernate related examples I saw on the net use Spring. We do not use Spring. So could it be possible for you to post XA-Hibernate sample w/out using Spring.

Let me know your thoughts.


Thanks,

Manish
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


I believe using XA implies 2PC which will try to synchronize transaction across the database. How can I overcome this overhead while still using XA.

Is this not the only reason to use an XA DataSource in the first place? If you don't have a transaction that spans more than one resource why use it at all?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
manish ahuja
Ranch Hand

Joined: Oct 23, 2003
Posts: 312
Paul - Thanks for the response.

I have gone through a bit of documentation on the same but have not got the clear idea of how the transaction manager interplays with XA datasource or say plain datasource in general

------------
Also another question is regarding Transaction Manager. Is it imperative to use the transaction manager if we want to implement XA datasource or plain datasource. Can I do w/out transaction manager and still use datasource for database communication.
-----------
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate and XA datasource
 
Similar Threads
Problem setting up dukes bank application with Oracle
Spring Framework and Hibernate
Connecting to two schemas using hibernate
Problem in putting a dataSource for the Oracle 9i database on JBoss for entity beans
Transaction not active error