wood burning stoves
The moose likes BEA/Weblogic and the fly likes 2 phase commit in java !!!!!!!!! URGENT!!!!!!!!!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "2 phase commit in java !!!!!!!!! URGENT!!!!!!!!!!!" Watch "2 phase commit in java !!!!!!!!! URGENT!!!!!!!!!!!" New topic

2 phase commit in java !!!!!!!!! URGENT!!!!!!!!!!!

parthasarathy madhira
Ranch Hand

Joined: Aug 31, 2001
Posts: 41
Can I implement 2 phase commit in a standalone java application ?
I access multiple databases with different connection objects in a single class in a single transaction. But how do I implement the 2 phase commit manually in a java standalone application.
Please note that I dont have any environment(like server, jndi etc.,) where i can deploy the datasources.
So pls let me know whether i can implement distributed transactions in this scenario.
This is very urgent.

Joined: Jan 24, 2002
Posts: 4
You can use JTA for doing this. You may need to study the JTS and it's specimen implementation with App Servers for using it.
Kyle Brown
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
Sigh... But JTA requires the implementation of a Transaction Manager -- which are only implemented in applicatoin servers... My question is WHY can't you start up a copy of an application server (even something free like JBoss or Pramati) to act as your Transaction manager and to define your datasources? Then your Java program would just be a normal J2EE Java client... (even though there would be no EJB's or Web apps).

Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
Akhil Nagpal

Joined: Sep 18, 2002
Posts: 5
u dont need to have a application server to make use of TransactionManager. There are many transcation manager available for free like "atomikos TransactionJTA" which provide TransactionManager. Just use its class directly and have your work done by it i.e. 2PC .
Akhil Nagpal
parthasarathy madhira
Ranch Hand

Joined: Aug 31, 2001
Posts: 41
Thnks a lot Kyle and Nagpal,
I'll surely try your suggestions.
These would be of great help for me probably.

I agree. Here's the link: http://aspose.com/file-tools
subject: 2 phase commit in java !!!!!!!!! URGENT!!!!!!!!!!!
It's not a secret anymore!