Icon View Incident Report

Minor Minor
Reported By: Roy Lambert
Reported On: 2/8/2007
For: Version 4.25 Build 3
# 2297 Creating Indexes on Tables Causes Lock Table Entry When it Shoudn't

I've run into the problem with the database filling up.

DoBayesianFilter is called from several threads in several places. As part of it some tables are opened and one memory table created. To ensure I have a unique analysis table I use GetTickCount and add it to a table name (I doubt anything it does will take less than 1ms). At the end of the procedure I clean up the tables and delete the in-memory one.

This all seems to be fine until I run a menu option which checks out all messages and spam on file then it blows up.

I can close and restart the app and it runs to the same point each time so I'm betting its nothing to do with the lock file, and if I alter the table name to be a constant (I can't in real life) it runs all the way through.

procedure SetUpForFiltering;
var
bfTableName: string;
begin
bfTableName := 'bfMsg' + IntToStr(GetTickCount);
bfSession := MakeDBISAMSession;
Bayesian := MakeDBISAMTable('Bayesian', slOptsStr('_DataPath'), bfSession);
Bayesian.Open;
// First create an interim analysis table
Maker := MakeDBISAMQuery('Memory', bfSession);
Maker.SQL.Add('DROP TABLE IF EXISTS "Memory\' + bfTableName + '";');
Maker.SQL.Add('CREATE TABLE IF NOT EXISTS "Memory\' + bfTableName + '"');
Maker.SQL.Add('(');
Maker.SQL.Add('"_Token" VARCHAR(60),');
Maker.SQL.Add('"_MsgCount" INTEGER,');
Maker.SQL.Add('"_Probability" FLOAT,');
Maker.SQL.Add('"_Significance" FLOAT,');
Maker.SQL.Add('PRIMARY KEY ("_Token") COMPRESS NONE');
Maker.SQL.Add('LOCALE CODE 0');
Maker.SQL.Add('USER MAJOR VERSION 1');
Maker.SQL.Add(');');
Maker.SQL.Add('CREATE INDEX IF NOT EXISTS "Chance" '+
              'ON "Memory\' + bfTableName + '" ("_Probability") COMPRESS NONE;');
Maker.SQL.Add('CREATE INDEX IF NOT EXISTS "Significance" ON '+
              '"Memory\' + bfTableName + '" ("_Significance") COMPRESS NONE;');

Maker.ExecSQL;
Maker.Close;
Maker.Free;
bfMsg := MakeDBISAMTable(bfTableName, 'Memory', bfSession);
bfMsg.Exclusive := True;
bfMsg.Open;
SpamStats := MakeDBISAMTable('SpamStats', slOptsStr('_DataPath'), bfSession);
SpamStats.Open;
end;



Resolution Resolution
Fixed Problem on 3/28/2007 in version 4.24 build 4


Products Affected Products Affected
DBISAM CLX Client-Server
DBISAM CLX Client-Server with Source
DBISAM CLX Standard
DBISAM CLX Standard with Source
DBISAM VCL Client-Server
DBISAM VCL Client-Server with Source
DBISAM VCL Standard
DBISAM VCL Standard with Source
DBISAM VCL Trial

Image