Subject Multithreaded application problem
Author Robert martin
Hi All

We are having strange problems with a multithreaded application using IBO
components. This app runs fine on many (dozens) of machines however on
Newer P4 machines running at 2.8Ghz (may be other higher speeds but thus far
only 2.8 machines have been tested) and windows XP SP2 we are having
problems.

The following code is in the execute part of a thread. The code crashes
(Locks?) when trying to open the increment table. The exception either does
not trigger or fails to save any message to the error file.

I have traced the code by logging actions to a log. All components are
created on the fly (No DM used here). TwsTable inherits from TIBOTable.
The main VCL thread is running simultaneously. The application appears to
lock, using 100% processor time. It never recovers.

Am I doing something obviously wrong / dangerous? Any suggestions?


if (ClientSesion = Nil) then begin
ClientSesion := TIB_Session.Create(Nil);

ClientSesion.UseCursor := False;

//RM 22/06/2004 Firebird - Create Database for all table components
IBODataBase := TIBODatabase.Create(ClientSesion);
IBODataBase.Path := Owner.DataBasefullPath;
IBODataBase.Password := WS_DB_PASSWORD;
IBODataBase.Username := WS_DB_USERNAME;
IBODataBase.Protocol := cpTCP_IP;
IBODataBase.PageSize := WS_DB_PAGESIZE;
IBODataBase.IB_Session := ClientSesion;
IBODataBase.SQLDialect := 3;
IBODataBase.Connected := True;

IncrementTable := TwsTable.Create(ClientSesion);
IncrementTable.IB_Connection := IBODataBase;
IncrementTable.TableName := 'Increment';
try
IncrementTable.OpenIfClosed;
except
on e: exception do begin
RecordServerError('ROB TEST **', 'Processing Thread - 2d', 1, Now,
e.message); //RM 27/10/2004 Testing
end;
end;
end;

while Terminated = False do begin
........


Rob Martin
Software Engineer

phone 03 377 0495
fax 03 377 0496
web www.chreos.com
Wild Software Ltd