Error on Backup Service running in Thread

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
sugi
Posts: 43
Joined: Wed 07 Dec 2016 02:05

Error on Backup Service running in Thread

Post by sugi » Wed 21 Jun 2017 04:37

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

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Error on Backup Service running in Thread

Post by ViktorV » Thu 22 Jun 2017 07:44

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.

Post Reply