jQuery in Action, 2nd edition*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 8904

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: 8904

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: 8904

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: 8904

It should work fine if your are using XA Drivers for accessing database.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: 2 phase commit
 
Similar Threads
What is 2 phase-commit ?
Hibernate Transaction
two phase commit
Transaction and 2 PC
mock exam + MDB transaction