GeeCON Prague 2014*
The moose likes JDBC and the fly likes Apply transaction on two different database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "Apply transaction on two different database" Watch "Apply transaction on two different database" New topic
Author

Apply transaction on two different database

Praveen Sharma
Ranch Hand

Joined: Jul 31, 2008
Posts: 129
Came across a problem which I could not answer , so I was hoping that I get some replies which might help me gain some knowledge.

Scenarios:
The data access layer (DAO layer) has two connection objects lets say: connection1 and connection2. These two connection objects need to update two different databases.

Problem:
Apply transactions so that these two update operations work as an atomic operations. There is no restriction on were we can apply the transaction.


SCJP 80% SCWCD 89%
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42053
    
  64
That's what distributed transactions do: http://docs.oracle.com/cd/E11882_01/java.112/e16548/xadistra.htm


Ping & DNS - my free Android networking tools app
Praveen Sharma
Ranch Hand

Joined: Jul 31, 2008
Posts: 129
Thanks a lot Ulf. This will be quite a read.
 
GeeCON Prague 2014
 
subject: Apply transaction on two different database