UniDAC in an Application Server (multi-thread)

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Ivan_Carpio89
Posts: 29
Joined: Mon 10 Dec 2018 23:49

UniDAC in an Application Server (multi-thread)

Post by Ivan_Carpio89 » Thu 13 Dec 2018 20:02

Hello,

Is it possible to use UniDAC in multi-threaded applications?

I work on a project that is an Application Server, and has threads to handle requests, and each thread has its own connections (TFDConnection's), TFDQuery's and TFDTable's, under this scenario or multi-threaded architecture, does UniDAC work?

Thanks in advance.

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: UniDAC in an Application Server (multi-thread)

Post by azyk » Fri 14 Dec 2018 10:10

To ensure thread safety in multi-threaded UniDAC applications, you should use a separate TUniConnection instance for each thread.

Thus, all you need to do is to replace TFDConnection's, TFDQuery's and TFDTable's with similar UniDAC components.

Ivan_Carpio89
Posts: 29
Joined: Mon 10 Dec 2018 23:49

Re: UniDAC in an Application Server (multi-thread)

Post by Ivan_Carpio89 » Fri 14 Dec 2018 16:44

Perfect, thank you very much.

Post Reply