The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Two phase commits for EJBs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Two phase commits for EJBs" Watch "Two phase commits for EJBs" New topic

Two phase commits for EJBs

Vishwa Kumba
Ranch Hand

Joined: Aug 27, 2003
Posts: 1066
Should all vendors support Two phase commits for EJBs?.
I understand two-phase commit as being for distributed databases.
But can somebody give me a practical scenario where two phase commits are used for EJBs, please. Just an example would do.
Kathy Sierra
Cowgirl and Author

Joined: Oct 10, 2002
Posts: 1589
Two-phase commit, as a protocol for distributed transactions, could be used where multiple distributed *participants* are involved in the transaction, which could be anything -- another EJB server, a couple of different databases, etc. So it's just the way the transaction manager (as part of the server) can make sure that all participants have agreed to commit (phase one) before TELLING them to go ahead and do it (phase two).
Two-phase commit is not absolutely mandated as the protocol for EJB servers to use, but it is one example (by far, the most typical) of an implementation of distributed transaction management.
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
This image is explain about two phase commit.

Java Developer, Thailand
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
I agree. Here's the link:
subject: Two phase commits for EJBs
It's not a secret anymore!