Subject Re: [firebird-support] Re: InterBase, Dephi, BDE and Transactions
Author Gustavo
Helen:

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

Anyway I still don´t understand what you´re saying about writing

if DataBaseGeneral.InTransaction then
begin
DataBaseGeneral.Commit;
DataBaseGeneral.StartTransaction;

before the Open.

I wrote that but, as I expected, it did nothing because DataBaseGeneral.InTransaction is False.

Do you have any suggestion of what can I do to make this work?


Gustavo
----- Original Message -----
From: Helen Borrie
To: firebird-support@yahoogroups.com
Sent: Tuesday, November 16, 2004 12:05 PM
Subject: RE: [firebird-support] Re: InterBase, Dephi, BDE and Transactions


At 11:47 AM 16/11/2004 -0300, you wrote:

>Helen:
>
> I don't understand. You say
>"Next, if Delphi gets an Open call and there is no transaction, it starts
>one."
>
>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.

Helen

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

:-|

./h



[Non-text portions of this message have been removed]