Subject RE: [firebird-support] Re: InterBase, Dephi, BDE and Transactions
Author Helen Borrie
At 11:47 AM 16/11/2004 -0300, you wrote:

> I don't understand. You say
>"Next, if Delphi gets an Open call and there is no transaction, it starts
>and tell me to write:
> if DataBaseGeneral.InTransaction then
> begin
> DataBaseGeneral.Commit;
> DataBaseGeneral.StartTransaction;

No. I said "You could have done this (if you wanted to take explicit
control of the transaction".

>Do I have to write this before or after the Open?

If you do it, it has to be BEFORE the Open. An Open is nothing but
submitting a SELECT request and asking Delphi to keep fetching until the
buffer is filled. If the query isn't prepared, Delphi sets up the stuff
for the prepare and asks the databases to prepare it. The Prepare returns
a whole lot of stuff from the database, before Open gets called.

The point is, that all of the above things happen INSIDE the context of the
transaction. If there is no transaction, there is nothing.


>Anyway, I think it won't do nothing because DataBaseGeneral.InTransaction
>is False in both cases.