File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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