This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes what is two way commit Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply Bookmark "what is two way commit" Watch "what is two way commit" New topic
Author

what is two way commit

kiran kumar
Greenhorn

Joined: Feb 07, 2005
Posts: 29
Hi
what is two way commit in transactions.
can you please explain that.
Saket Barve
Ranch Hand

Joined: Dec 19, 2002
Posts: 224
Two-phase commit is a protocol used by the JTA. Any commit is done in two stages:

1. JTS asks EACH ResourceManager if they is ready to commit.
2. If yes (for all), the JTS goes ahead and commits. If no (even for a single ResourceManager) the transaction is aborted.

Regards,
Saket
Nischal Tanna
Ranch Hand

Joined: Aug 19, 2003
Posts: 182
Two way commit can be useful for distributed transactions

for e.g. u call a Message Driven Bean (asynchronously) as well as a Database operation. So before comitting the transaction (message will be send to the Resource Manager of both the Transactions asking for their acknwoledgement. If yes (from both), commit . if no (from either), rollback).
[ March 16, 2005: Message edited by: Nischal Tanna ]

Thnx
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: what is two way commit
 
Similar Threads
Unable to commit connection in global Tran
When life becomes meaningless......
Transactions with Stored Procedures
Two TransactionTemplate use my single application.
XADataswource