• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to use MS SQL and DB2 in the same transaction

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author
Posts: 531
Mac OS X Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic