You should use Spring to manage all of your objects, that
includes your Dao's. Next you will need to use an external Transaction Manager
that supports XA 2pc. There are several out there to choose from. I would
recommend Bitronix (http://bitronix.be/)
or Atomikos (http://www.atomikos.com/). Lastly you will
need to leverage Springs Transaction Management. My recommendation would be to
use Annotations. This give granular control over your transaction boundaries.
The Spring reference guide gives very good details of how to perform
this.
The configuration is relatively easy to do so long as
you read the docs and understand what it is you are doing. XA is not easy but
with Spring and a good TX Manager it becomes seamless.
BTW, last time I used Oracle with DB2 I was unable to use
2PC with DB2's type 4 JDBC driver. You should read through the documentation
pertaining to the Driver to ensure that it supports 2PC. I know for a fact that
DB2's type 2 driver does.
From: Seth Helstrip <[EMAIL PROTECTED]> [mailto:Seth Helstrip <[EMAIL PROTECTED]>]
Sent: Thursday, March 29, 2007 7:23 AM
To: [email protected]
Subject: Transaction Control across multiple datasources
offer me some form of transaction management advise?
I'm using Spring MVC with iBatis, and so far, have
been mightily impressed with both technologies.
Within my application I have the need to maintain
transactions across two datasources and daoconfig,
each pointing at a different db implementation - one
Oracle, one DB2.
Since I'm using Spring I was wondering whether the
best way to do this would be to use EXTERNAL
transaction management within iBatis and to somehow
span the two DAO activities using a Spring transaction
mechanism.
I'm not using Spring IoC - and as such, think this
approach may require some messy coding.
Any advise will be greatly appreciated.
Thanks in advance,
Seth
____________________________________________________________________________________
Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121
