Subject Re: [firebird-support] Strange performance problems
Author Tim Ledgerwood
>I have run into this many times with IB6 and IBExpert. If I open a table for
>edit in IBExpert and dont commit the transaction and my application tries to
>read that record, my app will just sit there and wait until I commit or
>rollback
>the edit.
>
>I can't remember if I could duplicate this issue with IBConsol.
>
>Btw, can you duplicate the behavior by running a script in IBConsole that
>mimics
>your application behavior?
>
>Raf

Hi Raf,

We don't use tables at all - only queries and stored procedures. The
queries and
stored procedures all happen within a transaction context, and the data set
is closed
and the transaction committed as soon as the client application is finished
with it.

In many cases, the code looks something like this :

function getvalue(recordid : integer) : string;
var
ReturnValue : String;
begin
ReturnValue := 'NONE';
try
try
with adataset do
begin
if active then close;
if not transaction.intransaction then
transaction.starttransaction;
//fill the input parameters and open the dataset
end;
ReturnValue := adataset.fieldbyname('value').AsString;
except
begin
//exception handling code here
end;
end;
finally
begin
adataset.transaction.commit;
adataset.close;
end;
end;
result := ReturnValue;
end;

There is also exception handling code within the procedure. The point is
that the database
transactions are as atomic as I can possibly make them - they never last
longer than they
absolutely have to.

The other point is that if it were a problem with transactions, I would
expect that the
problem ALWAYS happens. Instead, the problem is intermittent, which is one
of the reasons
that it is difficult to identify.

Regards

Tim


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