AutoCommit and Firebird

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
acastiello
Posts: 7
Joined: Tue 01 Feb 2011 16:21

AutoCommit and Firebird

Post by acastiello » Fri 11 Feb 2011 20:34

I´m migrating a lot of apps from the Delphi 2007 bundled IB components to UniDAC and found that my statements are commited if I don´t manually start a transaction in the TUniConnection (the so called AutoCommit).

Is there a way to by pass this behaviour?. IB bundled components don´t need to start a transaction since they use the Firebird default one. Maybe not the best practice, but the (very large) code being migrated is based on such fact and does not start transactions. Only commits them. An AutoCommit property for the TUniConnection will be nice!

Also, IB component TIBDatabase (which is the equivalent to TUniConnection) has a "DefaultTransaction" property which is very handy since insted of checking the InTransaction property of the TIBDatabase it can be done in the TIBTransaction component.



Regards,
Alvaro Castiello

AndreyZ

Post by AndreyZ » Mon 14 Feb 2011 15:07

Hello,

We will add the AutoCommit option in one of the next UniDAC build.
The point is that UniDAC serves for working with different databases, and its functionality is common for all supported servers. That's why the UniConnection component doesn't have the DefaultTransaction property. You can use the UniConnection.InTransaction property for checking if the internal default transaction is active.
Also, if you are working only with Firebird, maybe you will be interested in using IBDAC components that are intended for working with InterBase, Firebird and Yaffil database servers. The IBCConnection has the DefaultTransaction and AutoCommit properties, the TIBCTable and TIBCQuery components have the AutoCommit properties as well. You can find more information about IBDAC here: http://www.devart.com/ibdac

acastiello
Posts: 7
Joined: Tue 01 Feb 2011 16:21

Post by acastiello » Mon 14 Feb 2011 18:03

AndreyZ wrote:Hello,

We will add the AutoCommit option in one of the next UniDAC build.
The point is that UniDAC serves for working with different databases, and its functionality is common for all supported servers. That's why the UniConnection component doesn't have the DefaultTransaction property. You can use the UniConnection.InTransaction property for checking if the internal default transaction is active.
Those are good news!, since the code being ported does not check InTransaction, only commits since it "trusts" the default connection
AndreyZ wrote:Also, if you are working only with Firebird, maybe you will be interested in using IBDAC components that are intended for working with InterBase, Firebird and Yaffil database servers. The IBCConnection has the DefaultTransaction and AutoCommit properties, the TIBCTable and TIBCQuery components have the AutoCommit properties as well. You can find more information about IBDAC here: http://www.devart.com/ibdac
Unfortunately is not the case. Most of the apps are using FB but many others use Oracle. Again, trusting the default conection is not the best practice (and we are inserting InTransaction/StartTransaction pairs in the code), but for a fast, reliable porting, such property will be nice!

Regards,
Alvaro

Post Reply