wood burning stoves*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 41155
    
  45
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.
 
 
subject: Apply transaction on two different database
 
Similar Threads
Transaction handling in JDBC
CMT - Pooled connection availability
Regarding stale data in Value Objects pattern
Making a JEE application without using ORM
EJB vs Java Beans--design choice