Icon View Thread

The following is the text of the current message along with any replies.
Messages 21 to 26 of 26 total
Thread 2.28b2: BufferedFileIOSettings, published properties
Mon, Apr 9 2018 8:03 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Michael,

Just to clarify - Terry's issue resulted in an actual EDB corruption error message that was triggered by EDB due to an invalid state (the read-ahead functionality was trying to read too far in the file).  It wasn't due to a write flag being seen on an EDB table, which is what you're seeing.

So, I think that you probably still have an issue with your multi-threading code.

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Apr 9 2018 10:58 AMPermanent Link

Charalampos Michael

Tim,

<< So, I think that you probably still have an issue with your multi-threading code.>>

Runnning almost a day, No error message on the server! I close it and run repair on all tables
Darn, you're right ...

Verification of the table Devices started at 2018-04-09 17:43:47.659
Verification error for the index idxConnected in the Devices table (Invalid index key value for row 6 ()) - Fixed
Verification of the table Devices ended at 2018-04-09 17:43:47.722

At least i didn't get any error messages Smile
I'll switch to kbmMW queries only, i hope this will resolve my problem.

ps: Here's my thread EDBQuery, do you see something wrong ?

type
 TThreadQuery = class
 private
   FSession: TEDBSession;
   FDatabase: TEDBDatabase;
   FQuery: TEDBQuery;
 published
   constructor Create;
   destructor Destroy; override;

   property Query: TEDBQuery read FQuery write FQuery;
 end;

function CreateSession: TEDBSession;
begin
 EnterCriticalSection(vCriticalSection);
 try
   Result := TEDBSession.Create(nil);

   with Result do
   begin
     Inc(vSessionCount);
     SessionName := cDatabaseIDName + vSessionCount.ToString;

     LoginUser := 'Administrator';
     LoginPassword := 'EDBDefault';
   end;
 finally
   LeaveCriticalSection(vCriticalSection);
 end;
end;

function CreateDatabase(const ASession: TEDBSession): TEDBDatabase;
begin
 Result := TEDBDatabase.Create(nil);

 with Result do
 begin
   SessionName := ASession.SessionName;
   DatabaseName := cDatabaseIDName + vSessionCount.ToString;
   Database := 'Database';
   Connected := True;
 end;
end;

constructor TThreadQuery.Create;
begin
 FSession := CreateSession;
 FDatabase := CreateDatabase(FSession);
 FQuery := TEDBQuery.Create(nil);

 with FQuery do
 begin
   SessionName := FSession.SessionName;
   DatabaseName := FDatabase.DatabaseName;
 end;
end;

destructor TThreadQuery.Destroy;
begin
 FreeAndNil(FQuery);
 FreeAndNil(FDatabase);
 FreeAndNil(FSession);

 inherited;
end;

initialization
 vSessionCount := 0;
 InitializeCriticalSection(vCriticalSection);
finalization
 DeleteCriticalSection(vCriticalSection);
end.

---------

And an example how i call it:
function ExecuteQuery(const ASQL: String): Integer;
var
 vQuery: TThreadQuery;
begin
 vQuery := TThreadQuery.Create;

 with vQuery.Query do
 try
   SQL.Text := ASQL;
   ExecSQL;
   Result := RowsAffected;
 finally
   FreeAndNil(vQuery);
 end;
end;

Thank you
Mon, Apr 9 2018 12:04 PMPermanent Link

Charalampos Michael

Tim,
 Getting a Query from kbmMW connection pool:

Verification of the table Devices started at 2018-04-09 19:02:08.754
Verification error for the index idxConnected in the Devices table (Invalid index key value for row 1 ()) - Fixed
Verification of the table Devices ended at 2018-04-09 19:02:08.770

I really don't understand ... do you think it might be a kbmMW problem ?

Thank you
Mon, Apr 9 2018 1:36 PMPermanent Link

Charalampos Michael

Tim,
 Well i think i found the issue. It seems to be my fault with the way logging of users ... (thread within thread issues)

Thank you
Tue, Apr 10 2018 2:44 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Charalampos


Debugging threads comes second only to debugging visual controls in my scheme of hatefulness!

Roy Lambert
Tue, Apr 10 2018 11:33 AMPermanent Link

Charalampos Michael

Roy,

<< Debugging threads comes second only to debugging visual controls in my scheme of hatefulness! >>

Indeed !!!
« Previous PagePage 3 of 3
Jump to Page:  1 2 3
Image