File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "2 phase commit in java !!!!!!!!! URGENT!!!!!!!!!!!" Watch "2 phase commit in java !!!!!!!!! URGENT!!!!!!!!!!!" New topic
Author

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

parthasarathy madhira
Ranch Hand

Joined: Aug 31, 2001
Posts: 41
Hi,
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.
Aman
Greenhorn

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
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
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


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
Greenhorn

Joined: Sep 18, 2002
Posts: 5
HI,
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 .
Regards,
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.

Thanks
Partha
 
GeeCON Prague 2014
 
subject: 2 phase commit in java !!!!!!!!! URGENT!!!!!!!!!!!