Control transactions manually

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
dehorter
Posts: 45
Joined: Fri 16 Oct 2009 13:53

Control transactions manually

Post by dehorter » Mon 27 Jun 2016 10:48

Hi

I would like to control transactions manually (strictly);

Code: Select all

IF NOT transaction.Active then
    transaction.startTransaction;
SQL.PrepareSQL(True);

.....
IF transaction.Active then
    transaction.Commit;
But I have just realized that it is not really true.

Code: Select all

//IF NOT transaction.Active then
//    transaction.startTransaction;
SQL.PrepareSQL(True);

.....
IF transaction.Active then
    transaction.Commit;
also works because at "SQL.PrepareSQL(True)" transaction is automatically opens.
Is it possible to avoid that and that "SQL.PrepareSQL(True)" instruction create an error if the transaction is not explicitly opens ?
regards
olivier

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Control transactions manually

Post by ViktorV » Mon 27 Jun 2016 12:08

Yes, you are right. When executing the TIBCStoredProc.PrepareSQL method, the transaction used by the TIBCStoredProc component is starts automatically.
Currently, IBDAC doesn't support error generating on executing the TIBCStoredProc.PrepareSQL method, if the transaction wasn't started manually.
If you want us to implement the feature, please post it at our user voice forum: https://devart.uservoice.com/forums/104 ... e-firebird. If the suggestion gets a lot of votes, we will consider the possibility to implement it.

dehorter
Posts: 45
Joined: Fri 16 Oct 2009 13:53

Re: Control transactions manually

Post by dehorter » Tue 28 Jun 2016 09:07

Thanks

I add my vote to the "Add property AutoStartTransaction" proposal.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Control transactions manually

Post by ViktorV » Wed 29 Jun 2016 13:59

Thank you for your interest to our products.
If you have any questions during using our products, please don't hesitate to contact us - and we will try to help you solve them.

Post Reply