Hi According to the usecase whenever update happen it should update all the dbs in remote place.which are in different geographical locations.Whatever i understood about distributed transaction is: 1.I can configure the Datasource in application server which support global transaction. 2.In my code i need to get the datasource. 3.get a connection. 4.begin transaction. 5.update db 6.end transaction. But my doubt is i am having just one connection which i got for one db.so i can update that db.Can i use this connection to update other dbs?Is it a global connection. Can anyone explain me step 5 in details to update multiple db.
You do not have to do anything "special" to handle a distributed transaction. Conceptually, in between the begin and end of a transaction whatever you do is inside the ambit of that transaction. Whether you update 2 databases, 1 Database and 1 JMS queue or 100 databases, it does not really matter. All it matters is that the driver must support distributed transactions i.e. it must be an XA driver.
In case you are using weblogic, this article will give you a good idea.