Page 1 of 1

Two-Phase-Commitment?

Posted: Thu 30 Apr 2009 14:23
by vsck
Hi folks!

I'm working on a replication service with Delphi 2009 and IBDac (2.7). The prior version was a Delphi 5 project with ib objects.

I wondered if there is an equivalent to ibo's "two-phase-commitment". (Indeed, it's originally a firebird-function)

This function commits the data to the rdbms but flags it to rollback, if the connection is lost or another error happens. Next it commits the data to a second connection (=a second database) and after successful commitment it clears the flag from the first transaction.

I didn't find any particular resolution in your docs. Perhaps I can do this by hand but currently I don't have a clue how to start.

Perhaps you have any tips for me?

Thanks in advance!
Christian

Posted: Tue 05 May 2009 07:52
by Plash
You should place the TIBCTransaction component on the form. Add several connections using the AddConnection method. Then call StartTransaction.

After some changes call the Commit method of the TIBCTransaction component. This method will use two-phase commit automatically.

Posted: Tue 05 May 2009 11:32
by vsck
I'll try this.

Thanks for your help, Plash!