Fix over dblink?

If I connect to the oracle database as a user blacksmith and issue the following 3 commands:

update smith.tablea set col_name = 'florence' where col_id = 8; insert into bob.other_table@mylink values ('blah',2,'uncle','new'); commit; 

Does this mean that updating the local table (smith.tablea) and inserts in the remote db table (bob.other_table) were committed, or that only the local table was updated?

Note: "mylink" represents dblink for the remote database.

+4
source share
2 answers

In this case, the transaction should only work if the remote transaction and the local transaction are successful.

Additional information about distributed transactions:

http://docs.oracle.com/cd/B19306_01/server.102/b14231/ds_txnman.htm

+4
source

From the documentation

Oracle's two-phase commit mechanism is completely transparent to users who issue distributed transactions. In fact, users do not even need to know that the transaction is distributed. The COMMIT statement indicating the end of a transaction automatically triggers a two-phase commit mechanism to complete the transaction. No coding or complex expression syntax should include distributed transactions within the body of the database application.

so - yes, if all goes well, both operations will be completed.

+5
source

Source: https://habr.com/ru/post/1399984/


All Articles