This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Jdbc and Two 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 "Jdbc and Two Phase Commit" Watch "Jdbc and Two Phase Commit" New topic
Author

Jdbc and Two Phase Commit

Sujatha Kumar
Ranch Hand

Joined: Jan 05, 2004
Posts: 134
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


SCJP,SCWCD,SCBCD,SCEA Part I
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
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.


SCJP 1.4, SCWCD 1.3, SCBCD 1.3
 
jQuery in Action, 2nd edition
 
subject: Jdbc and Two Phase Commit
 
Similar Threads
how to rollback in java
Difference between Single phase and two phase commit
WSAD and JSQLConnect Driver
Two-phase commit using EJB
An MDB calling an Entity bean