Page 1 of 1

Error on Backup Service running in Thread

Posted: Wed 21 Jun 2017 04:37
by sugi
Hi guys,

I am running Backup service on thread, here are my codes

Code: Select all

void __fastcall BackupTread::Execute()
{
   Backup->Attach();
   Backup->ServiceStart();
}
//---------------------------------------------------------------------------
Those codes raised and Access violation error.
But if those codes remove to thread constructor, it runs OK.
Am I missing something here?

Environment : IBDAC 6.0.2 for C++ Builder 6

Regads,
Sugi

Re: Error on Backup Service running in Thread

Posted: Thu 22 Jun 2017 07:44
by ViktorV
To use the TIBCBackupService component in a multithreaded application correctly, you should perform all the preparatory steps (set the required properties (Server, Database, etc.) and call the TIBCBackupService.Attach and TIBCBackupService.ServiceStart methods) either in the thread constructor or in the Execute method of your thread, but do not separate them between the constructor and the Execute method of the thread.