aspose file tools*
The moose likes JDBC and the fly likes 2 phase commit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "2 phase commit" Watch "2 phase commit" New topic
Author

2 phase commit

Vedhas Pitkar
Ranch Hand

Joined: Jan 27, 2001
Posts: 445
Hi Ranchers,
Can anyone suggest how to implement 2 phase commit for distributed transactions/databases using JDBC/JTA?
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Originally posted by Vedhas Pitkar:
Hi Ranchers,
Can anyone suggest how to implement 2 phase commit for distributed transactions/databases using JDBC/JTA?


Why do need to implement it ? Just use a JDBC driver which is two phase commit compliant.


Groovy
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

A good read
http://edocs.bea.com/wls/docs70/faq/JTA.html#737730
Vedhas Pitkar
Ranch Hand

Joined: Jan 27, 2001
Posts: 445
Yes Pradip saw the link.Thanks a bundle!! But what happens if part of one transaction takes place on one database & the other part on a diff DB?
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Originally posted by Vedhas Pitkar:
Yes Pradip saw the link.Thanks a bundle!! But what happens if part of one transaction takes place on one database & the other part on a diff DB?


I did not understand your question. Are the databases of the same vendor or a different one?
Vedhas Pitkar
Ranch Hand

Joined: Jan 27, 2001
Posts: 445
Same vendor
Parent Transaction
Child Transacion 1: Database1
Child Transaction 2: Databse 2 (Copy of the above DB but on diff m/c). This transaction updates a diff table than in TX 1.
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

It should work fine if your are using XA Drivers for accessing database.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: 2 phase commit