jQuery in Action, 3rd edition
The moose likes JDBC and Relational Databases and the fly likes Java transaction service 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 » Databases » JDBC and Relational Databases
Bookmark "Java transaction service" Watch "Java transaction service" New topic

Java transaction service

Aniket Kedari
Ranch Hand

Joined: Jan 29, 2008
Posts: 30
Hi all,
I want to use Java Transaction service for distributed transaction management in my Java application.

I have 3 different databases to which I have to connect using 3 different Connection objects. I want to insert certain data in each of the 3 databases.
My requirement is that atomicity should be maintained. So either data should get inserted in all 3 databases or it should not get inserted in any of the databases.
I searched on net for this kind of transactions and I got http://java.sun.com/javaee/technologies/jts/index.jsp .
I could find its API here http://java.sun.com/products/jts/javadoc/index.html
But I am still not getting how implement transactions using it. Can somebody provide me with links to sample code or tutorials of Java Transaction Service.

Thanks in Advance,
Aniket Kedari
amit punekar
Ranch Hand

Joined: May 14, 2004
Posts: 544
AFAIK you will have to use some Application Server like IBM WebSphere or Weblogic that implements these APIs and then use TransacationManager to manage the transaction.
Please check your server's vendor documentation if you are using any.

I agree. Here's the link: http://aspose.com/file-tools
subject: Java transaction service
jQuery in Action, 3rd edition