Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use MS SQL and DB2 in the same transaction

 
Bala RThiagarajan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using both MS SQL and DB2 in the same transaction can any one tell how to create the Datasource object for this scenario in WSAD

[ January 28, 2008: Message edited by: Bala RThiagarajan ]
[ January 28, 2008: Message edited by: Bala RThiagarajan ]
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might want to look at Hibernate Shards. That is designed to assist in developing applications that go to multiple databases.

-Cameron McKenzie
 
Masoud Kalali
Author
Ranch Hand
Posts: 531
Java Mac OS X Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will need to create two DataSource with XA support. ( your driver should support XA and for SQL server you need to perform some manual steps like installing stored procedure)

You will need to begin a UserTrasaction including two connections one from SQL server datasource and the other from DB2 Datasource, Connections autoCommit should be false.
After you execute all statement on those two connection you can commit UserTransaction, this will commit DB2 and SQL Server connections' statement in a two phase manner.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic