Subject | TIBBackupservice and Threads |
---|---|
Author | Robert martin |
Post date | 2005-04-07T23:33:24Z |
Hi
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
backup.
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
else)
//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;
BackupFile.Clear;
BackupFile.Add(BackupName);
ServiceStart;
while (Eof = False) do begin
GetNextLine;
end;
end;
......
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
web www.chreos.com
Wild Software Ltd
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
backup.
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
else)
//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;
BackupFile.Clear;
BackupFile.Add(BackupName);
ServiceStart;
while (Eof = False) do begin
GetNextLine;
end;
end;
......
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
web www.chreos.com
Wild Software Ltd