Two-Phase-Commitment?

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
vsck
Posts: 2
Joined: Thu 30 Apr 2009 13:47

Two-Phase-Commitment?

Post by vsck » Thu 30 Apr 2009 14:23

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 05 May 2009 07:52

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.

vsck
Posts: 2
Joined: Thu 30 Apr 2009 13:47

Post by vsck » Tue 05 May 2009 11:32

I'll try this.

Thanks for your help, Plash!

Post Reply