Обсуждение: dblink and commit

Поиск
Список
Период
Сортировка

dblink and commit

От
Daniel Chiaramello
Дата:
Hello.

I an wondering how things happen, related to transactions using dblink.

I am doing the following thing (simplified, of course), on ServerA:

------------------------------------------------
BEGIN

insert into TableA_ServerA (...)
    select * from dblink(ServerB, select * from tableA_ServerB)

insert into TableB_ServerA (...)
    select * from dblink(ServerB, select * from tableB_ServerB)

dblink(serverB, delete from tableA_ServerB)
dblink(serverB, delete from tableB_ServerB)

COMMIT
------------------------------------------------

What happens if connection is lost when executing the last dblink? Are
the data from tableA_serverB deleted (what I would like to avoid)?

If they are deleted, is there a way to handle this - do the 2 local
insert and the 2 remote delete (normal case), but do nothing at all if
something went bad at one time?

Thanks for your attention,
Daniel