Page 1 of 1

UniDAC in an Application Server (multi-thread)

Posted: Thu 13 Dec 2018 20:02
by Ivan_Carpio89
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.

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

Posted: Fri 14 Dec 2018 10:10
by azyk
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.

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

Posted: Fri 14 Dec 2018 16:44
by Ivan_Carpio89
Perfect, thank you very much.

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

Posted: Tue 14 May 2019 11:50
by lifeform
i have similar problem,
i use omniThreadLibrary for the thread. and in the process i need to connect the database to check the qty stock.
after running sometime, creating connection failed, it said max connection reached in the pool.
i set max 200 and min 2. lifetime just 5.

in this forum, i check that i must set the pooling to true. and every single thread must have seperate connection to database, right?

how to programming unidac with thread in right coding? i am lost here... please help
some example will be nice

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

Posted: Mon 27 May 2019 08:39
by MaximG
As indicated earlier, each single thread must have a separate TUniConnection instance when you develop multuthread applications with UniDAC. If you are you getting the error when the Pooling property is set to False, please compose and send us a code sample that would allows us to reproduce the issue in our environment. For your convenience, please use the e-support form https://www.devart.com/company/contactform.html