• Post Reply Bookmark Topic Watch Topic
  • New Topic

Jdbc and Two Phase Commit

 
Sujatha Kumar
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

This might be a dumb question.
But it would be great if you could share your thoughts.

Is it possible to achieve two-phase commit using pure JDBC ?

Assuming that you have two web servers supporting two different
database, In this case how can i achieve two-phase commit
across the webservers.

I was just curious about this scenario...

Regards
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nope, a JDBC transaction is a local transaction. For a distributed transaction, you need JTA. You will need amongst other things, a transaction manager, XA-enabled databases and resource managers (such as XA JDBC drivers). Check your container and database documentation for details on how to get this working.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!