Subject TIBBackupservice and Threads
Author Robert martin

We are having some problems with our multi threaded application crashing
while doing a backup using the TIBBackupService component.

What happens...
One instance of our application logs into our server app and triggers a
The server app creates a Thread that runs the backup service (code shown
further down).
CPU usage goes to 100% with FBserver using most of it (99% ish) - FB
super server 1.5.
Another client app tries to log into our server app.
During the log in process the server runs a query, at this point the app
stops (no crash) and locks up.
CPU usage drops to 0.

some code from the backup thread (we are using IBObjects for everything

//In the execute method
fIB_Session := TIB_Session.Create(Nil);
fIB_Session.UseCursor := False;

fIBODatabase := TIBODatabase.Create(fIB_Session);
fIBODataBase.DatabaseName := fDatabaseName;
fIBODataBase.Path := fDatabaseName;
fIBODataBase.Password := WS_DB_PASSWORD;
fIBODataBase.Username := WS_DB_USERNAME;
fIBODataBase.Protocol := cpTCP_IP;
fIBODataBase.PageSize := WS_DB_PAGESIZE;
fIBODataBase.IB_Session := fIB_Session;
fIBODataBase.SQLDialect := 3;

with IBBackupService do begin
ServerName := FindComputerName; //Server APP and DB are
always on the same machine
LoginPrompt := False;
Params.Add('user_name=' + UserName);
Params.Add('password=' + Password);
Verbose := True;
Options := [IgnoreLimbo];
DatabaseName := fIBODatabase.DatabaseName;



while (Eof = False) do begin

There is exception handling around all od this and nothing is
triggered. Does anyone have any suggestions, my Google search returns
little about TIBbackupService and comments that indicate it is Thread
safe. Help ...

Rob Martin
Software Engineer

phone +64 03 377 0495
fax +64 03 377 0496

Wild Software Ltd