Subject Re: Two Fase Commit
Author Alexander V.Nevsky
--- In firebird-support@yahoogroups.com, "Horacio Jamilis"
<hjamilis@y...> wrote:
> Hi,
>
> Can someone send me a code (or metacode) sample of the use of two
fase transaction.
> If the sample is in delphi code, better.

Horacio, it depends on components which you use. I can explain for
IBX only and it is simply. Let's say you have connections IBDataBase1
and IBDataBase2 and transaction IBTransaction1. For example,

IBDataBase1.Connected:=True;
IBDataBase2.Connected:=True;
IBTransaction1.AddDataBase(IBDataBase1);
IBTransaction1.AddDataBase(IBDataBase2);
IBTransaction1.StartTransaction;

now you can perform queries which Transaction property is set to
IBTransaction1 for both databases. When you'll commit IBTransaction1,
it will be commited in both databases, the same with rollback. If
connection with one of the databases will be lost before
commit/rollback, transaction in both databases will be marked "in
limbo" and you should rollback it manually using gfix tool.

Best regards,
Alexander.