Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 15 total
Thread 9480 The database '<DatabaseName>' is full and cannot contain any more tables
Thu, Feb 8 2007 8:35 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

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.


HELP

Roy Lambert


These are the only support functions/procedures that create tables in any way

function MakeDBISAMSession: TDBISAMSession;
begin
Result := TDBISAMSession.Create(nil);
Result.PrivateDir := GetWindowsTempPath;
Result.AutoSessionName := True;
Result.LockProtocol := lpPessimistic;
end;

function MakeDBISAMDatabase(const iSession: TDBISAMSession; const Path: string): TDBISAMDatabase;
begin
Result := TDBISAMDatabase.Create(nil);
Result.DatabaseName := 'db' + iSession.SessionName;
Result.Directory := Path;
Result.SessionName := iSession.SessionName;
end;

function MakeDBISAMTable(const iName: string; const iDBPath: string; const iSession: TDBISAMSession): TDBISAMTable;
begin
Result := TDBISAMTable.Create(nil);
Result.TableName := iName;
Result.DatabaseName := iDBPath;
Result.SessionName := iSession.SessionName;
end;

function MakeDBISAMQuery(const iDBPath: string; const iSession: TDBISAMSession): TDBISAMQuery;
begin
Result := TDBISAMQuery.Create(nil);
Result.DatabaseName := iDBPath;
Result.SessionName := iSession.SessionName;
end;




Attachments: BaysProgs.pas
Thu, Feb 8 2007 9:21 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

OK I've added a counter and its the 4096 limit. Why aren't tables removed from memory when deleted?

Roy Lambert
Thu, Feb 8 2007 1:48 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< OK I've added a counter and its the 4096 limit. Why aren't tables removed
from memory when deleted? >>

In-memory tables work exactly like disk-based tables, meaning that they are
hitting the same issue that disk-based tables have with the lock file.  If
you want to create that many temporary tables, then open them exclusively
and they won't be added to the lock file and they won't cause the problem.

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Feb 9 2007 4:13 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

It is opened exclusively.....


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;

Roy Lambert
Fri, Feb 9 2007 9:59 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim


Try the attached example. I've tried it a couple of times and get varying numbers of cycles eg 4704, 4693

It ain't the lock file.


Roy Lambert







Attachments: Unit1.pas Project1.dpr Unit1.dfm
Fri, Feb 9 2007 3:53 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< Try the attached example. I've tried it a couple of times and get varying
numbers of cycles eg 4704, 4693

It ain't the lock file. >>

Yes, it is the lock file.  That's the only way to cause the error.  I can't
see exactly what is going on with your project, however, because I don't
have the NLHRoutines unit.  Could you please email it to me ?

Thanks,

--
Tim Young
Elevate Software
www.elevatesoft.com

Sun, Feb 11 2007 11:05 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

Did you get the new .pas and is there anything else you need to tell me what's happening and fix either me or it?


Roy Lambert
Mon, Feb 12 2007 3:35 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< Did you get the new .pas and is there anything else you need to tell me
what's happening and fix either me or it? >>

I got the .pas, but I haven't had a chance to look at it yet.  I will let
you know via email.

--
Tim Young
Elevate Software
www.elevatesoft.com

Mon, Feb 19 2007 6:52 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim


Now ElevateDB has been release and you have lots of free time........


Roy Lambert
Mon, Feb 19 2007 6:56 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< Now ElevateDB has been release and you have lots of free time........ >>

Yeah, right. Smiley I still have that in my "emails to look at" list and I'll
see if I can get to it early this week.

--
Tim Young
Elevate Software
www.elevatesoft.com

Page 1 of 2Next Page »
Jump to Page:  1 2
Image