Subject | Re: The Database file is growing exponentialy with UPDATE query |
---|---|
Author | pierre.ghislain |
Post date | 2008-01-28T09:24:24Z |
Well,
my code is using the transaction process of Firebird:
in my program I call
DBexecSql( Sql1 ; 1 );
And the rest is done into a specific unit DBConnect.
Its more simple.
From CodeGear I have modify the SQLEXPR.PAS of Delphi 7 adding:
procedure TCustomSQLDataSet.CloseCursor;
begin
inherited CloseCursor;
// TopWare add
FreeStatement;
end;
but this is only creating a direct writing on the hard disk, and the
database continue to grow, grow, grow... This comment of borland was
made to resolve Commit Retain problem.
I now I should switch Delphi 7 to Delphi 2007 but there is no driver
for Firebird.
Thanks for your comments,
Pierre.
----------some parts of it---------------
procedure TDBconnect.StartT( TransactionID: Integer = 0 );
begin
TD[TransactionID].TransactionID := TransactionID + 1;
TD[TransactionID].IsolationLevel := xilREADCOMMITTED; // Aqui você
define a forma de isolamento da transação;
DBconnect.SQLConnection1.StartTransaction( TD[TransactionID] );
end;
procedure TDBconnect.CommitT( TransactionID: Integer = 0 );
begin
DBconnect.SQLConnection1.Commit( TD[TransactionID] );
end;
procedure TDBconnect.RollbackT( TransactionID: Integer = 0 );
begin
DBconnect.SQLConnection1.Rollback( TD[TransactionID] );
end;
procedure TDBconnect.DBexecSql( SqlQuery: TSQLQuery; TransactionID:
Integer );
begin
DBconnect.StartT(TransactionID);
try
try
SqlQuery.ExecSql;
except on e:exception do
ShowMessage( 'Err SQL ' + SqlQuery.SQL.Text + chr(13) + chr(10)
+ E.Message );
end;
finally
DBConnect.CommitT(TransactionID);
end;
end;
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@...>
wrote:
therefore, that you describe the workflow of this application: how
you start a transaction, how you execute a statement, how you finish
a transaction.
my code is using the transaction process of Firebird:
in my program I call
DBexecSql( Sql1 ; 1 );
And the rest is done into a specific unit DBConnect.
Its more simple.
From CodeGear I have modify the SQLEXPR.PAS of Delphi 7 adding:
procedure TCustomSQLDataSet.CloseCursor;
begin
inherited CloseCursor;
// TopWare add
FreeStatement;
end;
but this is only creating a direct writing on the hard disk, and the
database continue to grow, grow, grow... This comment of borland was
made to resolve Commit Retain problem.
I now I should switch Delphi 7 to Delphi 2007 but there is no driver
for Firebird.
Thanks for your comments,
Pierre.
----------some parts of it---------------
procedure TDBconnect.StartT( TransactionID: Integer = 0 );
begin
TD[TransactionID].TransactionID := TransactionID + 1;
TD[TransactionID].IsolationLevel := xilREADCOMMITTED; // Aqui você
define a forma de isolamento da transação;
DBconnect.SQLConnection1.StartTransaction( TD[TransactionID] );
end;
procedure TDBconnect.CommitT( TransactionID: Integer = 0 );
begin
DBconnect.SQLConnection1.Commit( TD[TransactionID] );
end;
procedure TDBconnect.RollbackT( TransactionID: Integer = 0 );
begin
DBconnect.SQLConnection1.Rollback( TD[TransactionID] );
end;
procedure TDBconnect.DBexecSql( SqlQuery: TSQLQuery; TransactionID:
Integer );
begin
DBconnect.StartT(TransactionID);
try
try
SqlQuery.ExecSql;
except on e:exception do
ShowMessage( 'Err SQL ' + SqlQuery.SQL.Text + chr(13) + chr(10)
+ E.Message );
end;
finally
DBConnect.CommitT(TransactionID);
end;
end;
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@...>
wrote:
>BDE?
> At 07:56 PM 25/01/2008, you wrote:
> >Hi there!
> >
> >I am using Firebird 2.0.3 (but I experience the same problem with
> >Firebird 1.5) on Windows XP. Default installation: Classic Server.
> >
> >Programming with Delphi 7 and using Interbse driver.
>
> What "Interbase driver"? Do you mean the InterBase driver for the
>1700
>
> >I have a table that I must UPDATE every 250 ms...
> >
> >Well, the database file grow, grow, grow... so much that FireBird,
> >after 1 day, is becomming very slow...
> >
> >The Database starts with 1700 Kb... and after one day it reaches
> >25.000 Kb.... 35.000 kb...
> >
> >So, I have resolve the problem making a backup and there after a
> >restore and... marvelous, the restored database go back to the
> >Kb size...code that makes hard commits in a timely manner. It is important,
> >
> >Can somebody come with a solution for me ?
>
> You must come up with a solution yourself, by writing application
therefore, that you describe the workflow of this application: how
you start a transaction, how you execute a statement, how you finish
a transaction.
>Firebird's multiple-row-version concurrency mechanism works...
> Perhaps, first, you could describe for us your understanding of how
>
> ./heLen
>