Using the IBCTransaction component

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Max Bernaert
Posts: 3
Joined: Mon 31 Jul 2006 10:25
Location: Belgium

Using the IBCTransaction component

Post by Max Bernaert » Mon 31 Jul 2006 10:37

I am using the trial Interbase Data Access components. Everything is working fine. In my applications, I programmed a commit and rollback at the database component level. Are there disadvantages to apply the same methods at the IBCConnection component ? (CommitRetaining and RollbackRetaining) or should I use an IBCTransaction component ?

Thanks for your reponse.

Max.

Alex
Posts: 655
Joined: Mon 08 Nov 2004 08:39

Post by Alex » Mon 31 Jul 2006 14:40

There is no big difference in using IBCConnection.StartTransacion/Commit/Rollback or TIBCTransacion component. IBCConnection transaction control functionality is applied to IBCConnection.DefaultTransaction. By default IBCConnection.DefaultTransaction is initialized with internal TIBCTransaction instance, but if you want you can assign any other TIBCTransaction instance to this property.
Also when you need to use more than one transaction on one connection you can add and link another TIBCTransaction components, by putting them on the form and setting their DefaultConnection properties.
We recommend to use one additional transaction (Update transaction) with each TIBCQuery or TIBCTable. In this case you can set TIBCConnection.DefaultTransaction in "Read-Only Read Committed" mode, and TIBCQuery.UpdateTransaction with "Read Committed" mode. This approach prevents InterBase/Firebird server from holding read transaction as OAT (Oldest Active Transaction) and filling up with unnecessary back versions of records.

Max Bernaert
Posts: 3
Joined: Mon 31 Jul 2006 10:25
Location: Belgium

Transactions handling

Post by Max Bernaert » Mon 31 Jul 2006 22:00

Thank you very much for this very helpful comments.

Max.

Post Reply