Subject Re: [IBO] Re: Database file size increases heavily
Author Arno Garrels
Marco,

Thank you very much for taking the time.

> Sorry, but can't be true. If true, al lot of people will have some GB
> database size.

Hopefully you are right.
But do they insert/delete records in a 1 min. loop 24/7?


> What isolation level do you use? Read committed, I hope.

tiCommitted, CommitAction=caInvalidateCursor.


> And what's the code that performs the delete and what performs the
> insert?

My first try:

Mastertbl.Close;
Detailtbl.Close;
DB.Commit;

DB.StartTransaction;
Detailtbl.EmptyTable;
DB.Commit;

DB.StartTransaction;
Mastertbl.EmptyTable;
DB.Commit;

Second try:

UnlinkTables;
DB.StartTransaction;
Mastertbl.Open;
while not Mastertbl.Eof do
Mastertbl.Delete;
DB.Commit;

DB.StartTransaction;
Detailtbl.Open;
while not Detailtbl.Eof do
Detailtbl.Delete;
Detailtbl.Close;
DB.Commit;
LinkTables;


Inserts:

Mastertbl is populated from a 'Select Query',
Query is closed then Commit is called.

Mastertbl.First;
DB.StartTransaction;
...
Recursive file search, using FindFirst/FindNext;

Detailtbl.Insert;
...
Detailtbl.FieldByName('PATH').AsString := Zip_Encrypt(FilePath);
tbl.Post;

Commit is called after ALL inserts for current master record are done, then
I go on with next master that starts a new transaction again.

When filling finished I iterate thru the records, start either FTP or SMTP
and send the files. SMTP/FTP results are written to another field 'Error' in
Detailtbl.
Those updates are committed after all detail records for a single master had
been updated.

At last I read field 'Error' in order to write a log file and empty both
tables.


> Have you some transaction of Concurrency type open in the
> meanwhile

Definitively NONE

> Are you using Firebird

WI-V6.2.794 Firebird 1.0


Arno Garrels