• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Distributed transactions across multiple databases

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 22848
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to JDBC.
 
Aniket Kedari
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can I use Java open Transaction Manager JOTM for this?
If yes can somebody point out to any tutorial
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic