• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

what is two way commit

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
what is two way commit in transactions.
can you please explain that.
 
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic