Subject | RE: [firebird-support] Re: InterBase, Dephi, BDE and Transactions |
---|---|
Author | Gustavo |
Post date | 2004-11-16T14:47:28Z |
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;
Do I have to write this before or after the Open?
Anyway, I think it won't do nothing because DataBaseGeneral.InTransaction is False in both cases.
Gustavo
----- Mensaje original -----
De: Helen Borrie
Para: firebird-support@yahoogroups.com
Enviado: Martes, 16 de Noviembre de 2004 03:17
Asunto: Re: [firebird-support] Re: InterBase, Dephi, BDE and Transactions
At 05:18 AM 16/11/2004 +0000, you wrote:
already started -- you can't Open a dataset if there is no transaction!!
To repeat the point ----
one. This is known as "Delphi's implicit transaction model". It doesn't
start transactions in RDBMSs that don't have them. :-)
To do this explicitly, you might have written code something like the
following:
if DataBaseGeneral.InTransaction then
begin
DataBaseGeneral.Commit;
DataBaseGeneral.StartTransaction;
another one while the current one is neither committed nor rolled
back. Delphi thinks you are trying to request a nested transaction and it
whines at you.
./hb
[Non-text portions of this message have been removed]
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;
Do I have to write this before or after the Open?
Anyway, I think it won't do nothing because DataBaseGeneral.InTransaction is False in both cases.
Gustavo
----- Mensaje original -----
De: Helen Borrie
Para: firebird-support@yahoogroups.com
Enviado: Martes, 16 de Noviembre de 2004 03:17
Asunto: Re: [firebird-support] Re: InterBase, Dephi, BDE and Transactions
At 05:18 AM 16/11/2004 +0000, you wrote:
>Helen (and the others who answered this question):When you call Open on a dataset, Delphi starts a transaction if one is not
>
>You say in my code I´m doing this:
>
>start transaction
> prepare query if not prepared
> run query (i.e. call Open)
> start another transaction
> do some stuff
> post changes
> .....
>
>I see your
>"start another transaction"
>
>is my
>"DataBaseGeneral.StartTransaction;"
>(after the Open)
>
>But I don´t see where is your first
>"start transaction"
>in my code.
already started -- you can't Open a dataset if there is no transaction!!
>If I debug and see DataBaseGeneral.InTransaction before theNot in my Delphi Help.
>DataBaseGeneral.StartTransaction, it is False. So, there is no
>Transaction started before the "DataBaseGeneral.StartTransaction;"
>instruction.
>
>Even in the Help of Delphi, it is explained that I have to do things
>the way I´m doing. That´s why I don´t understand the mistake.
>¿When does the first transaction you mention starts?See above.
To repeat the point ----
> > Your code:[snip]
> > > TablaDeProvincias:=TTable.Create(nil);Next, if Delphi gets an Open call and there is no transaction, it starts
> > > with TablaDeProvincias do
> > > begin
> > > TableName:='Provinc';
> > > IndexFieldNames:='NOMBRE';
> > > DataBaseName:=DataBaseGeneral.DataBaseName;
one. This is known as "Delphi's implicit transaction model". It doesn't
start transactions in RDBMSs that don't have them. :-)
To do this explicitly, you might have written code something like the
following:
if DataBaseGeneral.InTransaction then
begin
DataBaseGeneral.Commit;
DataBaseGeneral.StartTransaction;
> > > Open;and by now, the transaction is started, so you can't go a head and start
> > >
> > > DataBaseGeneral.StartTransaction;
another one while the current one is neither committed nor rolled
back. Delphi thinks you are trying to request a nested transaction and it
whines at you.
./hb
[Non-text portions of this message have been removed]