aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Two-phase commit in session 6.1.6 in EJB in Action (2nd edition) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Two-phase commit in session 6.1.6 in EJB in Action (2nd edition)" Watch "Two-phase commit in session 6.1.6 in EJB in Action (2nd edition)" New topic
Author

Two-phase commit in session 6.1.6 in EJB in Action (2nd edition)

Himai Minh
Ranch Hand

Joined: Jul 29, 2012
Posts: 758
In session 6.1.6, it says
quote 1:

In the first phrase, the transaction manager polls resource manager asking them if they are ready to commit. If all of the resource managers reply affirmatively, the transaction manager then issues a commit message to each resource manager. If any one of the resource managers responds negatively, the transaction is rolled back. Each resource manager is responsible for maintaining a transaction log....


quote 2:
In Figure 6.3, it shows phase 1 (voting phase),
each database reports back to the transaction manager that changes can be persisted. In phase 2 (commit phase), the transaction manager tells the individual database to commit.



In quote 1, the resource manager is involved. But in quote 2, there is no resource manager shown in the figure.
So, which statement is correct?

In my opinion, I think quote 2 is correct. The transaction manager interacts directly with the database, commit the changes or roll back to the original state.
If we use quote 1, the transaction manager has to interact with the resource manager, which takes longer time to commit or roll back. This may affect the performance.

Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3829

Here the resource managers are Databases systems, messaging systems and the likes. So it means the same thing I guess.


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Two-phase commit in session 6.1.6 in EJB in Action (2nd edition)