This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Kubernetes in Action and have Marko Luksa on-line!
See this thread for details.
Win a copy of Kubernetes in Action this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

2 phase commit  RSS feed

 
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,
Can anyone suggest how to implement 2 phase commit for distributed transactions/databases using JDBC/JTA?
 
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
 
Vedhas Pitkar
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 445
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It should work fine if your are using XA Drivers for accessing database.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!