Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate and XA datasource

 
manish ahuja
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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?
 
manish ahuja
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
-----------
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic