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

Distributed transactions across multiple databases

 
Aniket Kedari
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am developing an application in which I am using three different databases.(say db1, db2, db3).
Now I insert certain data in each of the databases. But if this insertion fails in any of the databases,
I have to rollback all transactions and terminate process.

Can anybody suggest how this can be achieved.

Thanks in advance,
Aniket
 
Rob Spoor
Sheriff
Pie
Posts: 20665
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to JDBC.
 
Aniket Kedari
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried to use aucommit(false) and then commit on individual connection if no error occurs.
But if there is an error during commit() of second connection, I wont be able to rollback changes done by commit of first database connection.
So is there a better way of doing this?
 
Aniket Kedari
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I use Java open Transaction Manager JOTM for this?
If yes can somebody point out to any tutorial
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic